We are having issues with reading POSTNET barcodes on some documents. On the document in question I get the attached error.Barcode Error.PNG (14.5 KB)
Any details on what might be causing this error would be appreciated. These same documents read every time with the 32 bit version of the Aspose dll but will not read with the 64 bit version of the dll files. Other documents with the same barcode in the same exact position on the page read fine.
Thank you,
Christine
@happysoftware,
Please share the sample POSTNET barcodes that you are using. We will evaluate it and update you about our findings.
Here are the 2 pages - the one named Page1 Reads works fine. The one named Page2 Does not Read produces the error above.Page1 Reads.pdf (2.6 MB)
Page2 Does not Read.pdf (2.6 MB)
Thank you - Christine
@happysoftware,
We have evaluated the samples shared by you with the latest version of the Aspose.BarCode. We are unable to reproduce the issue. Following are the results. Please try again with the latest version. In case of any issue, forward us a sample project demonstrating the issue. We will look into it and update you about our findings.
OUTPUT:
File Name: Page1 Reads.pdf
Codetext found: 14682285925, Symbology: Postnet
File Name: Page2 Does not Read.pdf
Codetext found: 14682285925, Symbology: Postnet
Thank you - I tested the files using the new version and still get the same result. I am using the MaxBarCodes recognition mode and we are cropping the image to a specific dimension where we expect the barcode to appear. Could you tell me the code you used to read the barcode or what may cause the initial error message to appear?
Any help would be greatly appreciated.
Thank you,
Christine
@happysoftware,
Apparently, it seems that cropping the image is causing the issue. However, following is the code snippet used to read the barcode from PDF.
CODE:
Aspose.Pdf.Facades.PdfExtractor pdfExtractor = new Aspose.Pdf.Facades.PdfExtractor();
pdfExtractor.BindPdf(@"Page1_Reads_POSTNET.pdf");
pdfExtractor.ExtractImage();
while (pdfExtractor.HasNextImage())
{
// save image to stream
System.IO.MemoryStream imageStream = new System.IO.MemoryStream();
pdfExtractor.GetNextImage(imageStream);
imageStream.Position = 0;
// recognize the barcode from the image stream above
Aspose.BarCode.BarCodeRecognition.BarCodeReader barcodeReader =
new Aspose.BarCode.BarCodeRecognition.BarCodeReader(imageStream);
while (barcodeReader.Read())
{
Console.WriteLine("Codetext found: " + barcodeReader.GetCodeText() + ", Symbology: " + barcodeReader.GetCodeType().ToString());
}
// close the reader
barcodeReader.Close();
}
Thank you for the sample code but we do not have a license for the Aspose.pdf product. Is there something you can recommend that uses existing functions of the Aspose.barcode toolkit that would help with the issues we are having? Is there something we are doing wrong in the crop function that is causing the barcode quality to be degraded. Currently we are converting the PDF to TIF and then cropping the area where the barcode is placed. When I try to scan the entire page for a barcode I get a memory error.
Any additional help would be greatly appreciated.
Thank you,
Christine
@happysoftware,
You can get a temporary license for 30 days to test theAspose.Pdf. Get a temporary license, use it in your test project and share the feedback. It would be a great help, if you share a sample project to demonstrate the issue. We will evaluate the sample project and update you with our findings.