We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Bar Code Recognition problem

I have a PDF file which was created from a fax image that includes a QR barcode on the page and the .Net 5.6 BarCodeRecognition component is not recognizing the barcode that exists on the page. I have included the pdf file as an attachment in this post.


Can someone from the Aspose team test it and see if there is an issue with the Aspose component?

Would appreciate the help and/or any direction on how to setup the recognition component such that the barcode can be recognized.

Hi Rob,


Thank you for contacting support. I’ve tested your sample PDF file against the latest builds of Aspose.BarCode 6.1.0 and Aspose.Pdf 9.0.0. The QR code can be recognized as follows:

// bind the pdf document<o:p></o:p>

PdfExtractor pdfExtractor = new PdfExtractor();

pdfExtractor.BindPdf("PDF+Upload+-+failure.pdf");

Console.WriteLine("Extracting images.....");

pdfExtractor.ExtractImage();

int i = 0;

// save images to stream in a loop

while (pdfExtractor.HasNextImage())

{

i++;

// save image to stream

MemoryStream imageStream = new MemoryStream();

pdfExtractor.GetNextImage(imageStream, ImageFormat.Png);

using (BarCodeReader barcodeReader = new BarCodeReader(imageStream, BarCodeReadType.QR))

{

barcodeReader.ImageBinarizationHints = RecognitionHints.ImageBinarization.MedianSmoothing;

while (barcodeReader.Read())

{

Console.WriteLine(i + " Codetext found: " + barcodeReader.GetCodeText() + ", Symbology: " + barcodeReader.GetReadType().ToString());

}

}

}


Result:
Extracting images…
1 Codetext found: 4711329C-EED9-4A79-A7AB-33571CF47BAB, Symbology: QR

Please do let us know in case of any comments or questions.

Thanks for the reply, making this code change worked perfectly.


Appreciate the help!

Hi Rob,


Thank you for the confirmation. It is nice to hear from you that the problem has been solved. Please feel free to ask if you have any question regarding Aspose.BarCode product family, we will be happy to help you.