Thank you for contacting support. We’ve tested your sample barcode image against the latest build of Aspose.BarCode for .NET 6.3.0. I can’t recognize QR code because the Read method is taking too long. This issue has been logged under ticket id BARCODENET-33926 in our issue tracking system. Your request has also been linked to this issue. We’ll keep you informed regarding any updates. We’re sorry for the inconvenience you faced.
Thank you for sharing the PDF documents. We’ve tested against the latest builds of Aspose.Pdf 9.3.0 and Aspose.BarCode 6.3.0. We can recognize QR codes as follows:
int pageIndex = 0;
// bind the pdf
PdfConverter converter = new PdfConverter();
converter.BindPdf(@"C:\test\2014_06_18_10_44_10_OCR.pdf");
converter.RenderingOptions.BarcodeOptimization = true;
converter.Resolution = new Aspose.Pdf.Devices.Resolution(300);
converter.DoConvert();
while (converter.HasNextImage())
{
pageIndex++;
MemoryStream pageStream = new MemoryStream();
converter.GetNextImage(pageStream, ImageFormat.Png);
Stopwatch stopwatch = new Stopwatch();
stopwatch.Start();
using (BarCodeReader reader = new BarCodeReader(pageStream, BarCodeReadType.QR))
{
while (reader.Read())
{
stopwatch.Stop();
Console.WriteLine("Page#" + pageIndex + " Code Text: " + reader.GetCodeText() + " Type: " + reader.GetReadType());
}
}
}
Results: ( 2014_06_18_10_44_10.pdf )
Page#1 Code Text: 12369 Type: QR
Page#2 Code Text: 12368 Type: QR
Results: ( 2014_06_18_10_44_10_OCR.pdf )
Page#1 Code Text: 12369 Type: QR
Page#2 Code Text: 12368 Type: QR
We hope, this helps. Please feel free to reply us in case of any confusion or questions.
Thank you for your inquiry. We have tried out your sample PDF document against the latest builds of Aspose.BarCode 6.3.0 and Aspose.Pdf 9.3.0. We managed to replicate the problem of recognition failure. It looks as the QR code is truncated. However, we have logged this issue under ticket id BARCODENET-33929 in our issue tracking system. Your request has also been linked to this issue. We’ll keep you informed regarding any updates. We’re sorry for the inconvenience you faced.
Thank you for your inquiry. We can now recognize the QR and Code128 codes using the latest code base. Our development team has not marked it as resolved because they are in progress to review the code. If everything goes fine through the QA phase, then we may able to include this fix in the upcoming release of Aspose.BarCode for .NET 6.4.0. We'll let you know once it is fixed.
erikg:
what does BarCodeReader.timeout represents. i can't find any usefull information regarding this property
I'm not certain about this property because it is not working as expected. I've logged my comments against the ticket id BARCODENET-33926. I'll let you know once any information is available from them.
Thank you for sharing the sample PDFs. We have tested against the latest builds of Aspose.BarCode 6.5.0 and Aspose.Pdf 9.6.0. We can recognize QR codes as follows:
int pageIndex = 0; // bind the pdf
PdfConverter converter = new PdfConverter();
converter.BindPdf(PDFLocalPath);
converter.RenderingOptions.BarcodeOptimization = true;
converter.DoConvert();
while (converter.HasNextImage())
{
pageIndex++;
MemoryStream pageStream = new MemoryStream();
converter.GetNextImage(pageStream, ImageFormat.Png); using (BarCodeReader reader = new BarCodeReader(pageStream, type))
{ while (reader.Read())
{
Console.WriteLine(“Page#” + pageIndex + " Code Text: " + reader.GetCodeText() + " Type: " + reader.GetReadType());
}
} }
It is nice to hear from you that you can now scan QR codes from the source PDFs. However, if you are reading codes from multiple images, then you can apply check on these two lines.
Thank you for being patient. We have a good news for you that the issue id BARCODENET-33929 has now been resolved. If there is no issue in the QA phase, then this fix will be included in the next version of Aspose.BarCode for .NET 6.9.0. We’ll inform you via this forum thread as soon as the new release is published.