Hi Munendra,
Thanks for considering Aspose.
Inserting the barcode in existing tif image is not supported in Aspose.BarCode, but you can insert the barcode image in an existing pdf file using Aspose.BarCode and Aspose.Pdf.Kit libraries. Here is the sample code for generating a barcode and inserting in an existing pdf file:
// generate a barcode image
BarCodeBuilder
barcode =
new BarCodeBuilder(
"test-123",
Symbology.Code39Extended);
MemoryStream
stream =
new MemoryStream();
barcode.Save(stream, System.Drawing.Imaging.ImageFormat.Bmp);
stream.Position = 0;
// read the stream in image to get the coordinates
Bitmap
bmp =
new Bitmap(stream);
int
nHeight = bmp.Height;
int
nWidth = bmp.Width;
stream.Position = 0;
// use Aspose.pdf.kit to insert image in existing pdf
string
strPdfFile =
@"E:\Data\Aspose\temp\test.pdf";
PdfFileMend
pdfFileMend =
new PdfFileMend(strPdfFile, strPdfFile);
// pass the image stream, page number and coordinates to the method
pdfFileMend.AddImage(stream, 1, 5, 5, nHeight, nWidth);
pdfFileMend.Close();
Removing the barcode images from pdf are currently out of scope of Aspose.BarCode product. You can acheive this using Aspose.Pdf.Kit component. Please check http://www.aspose.com/documentation/file-format-components/aspose.pdf.kit-for-.net-and-java/aspose.pdf.kit.pdfcontenteditor.deleteimage_overload_1.html method for deleting images from pdf documents. Please feel free to use http://www.aspose.com/community/forums/aspose.pdf.kit-for-.net-java-and-reporting-services/215/showforum.aspx forum for support related to the Pdf.Kit library.
While deleting the images, you need to check whether the image contains the barcode or not. If all the images in the pdf file are barcode images, then you can simply delete all the images, otherwise, you need to use recognition for each image to check whether it contains barcode or not.
Best Regards,
Saqib Razzaq
Support Developer, Aspose Sialkot Team
http://www.aspose.com
Your File Format Experts