Barcodes Inserted via Aspose Pdf Recognize Funny

Hi,


Here is my issue. Background first:
  1. We generate docs via aspose words.
  2. Then convert via aspose pdf.
  3. Then cycle through the pdf pages collection and
  4. Generate a different bar code per page
  5. Convert it to an image
  6. And insert it onto each page via the example in this demo.
  7. (The demo has some errors, so the image needs to be flipped a bit).
Everything in 1-7 words great. However, if we try to recognize the bar code on the generated pdf from above, we get funny results. But here’s the weird part. If we scan that same document, and then recognize it, we get correct results. BTW, we are using a DataMatrix, as well. We are open to other “square” code types, if necessary.

Specifically:
  1. The attached funny.pdf should product a recognized value of “Jimmy Test 1”, but instead, produces: “29957444 i41am4800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000”
  2. The attached correct.pdf works properly, returning “Jimmy Test 1”
Crazy, huh?

Here is the recognition code example that we are using. So, any ideas how to protect against incorrect results with number 1 above?

Thanks,

Jim


Hi James,


Thank you for your inquiry. First off, please try to use the latest version of Aspose.BarCode for .NET v5.3.0 and Aspose.Pdf for .NET v7.6.0 because each new release contains many improvements, bug fixes and new features. So, we suggest you always use the latest versions of Aspose products. You can download it from here:
http://www.aspose.com/community/files/51/.net-components/aspose.pdf-for-.net/default.aspx
http://www.aspose.com/community/files/51/.net-components/aspose.barcode-for-.net/default.aspx

I tested both Pdf files against the latest versions of Aspose.BarCode and Aspose.Pdf component. I would like to update you that I am able to recognize DataMatrix barcode with correct code text from funny.pdf file. Please follow up the source code below:

PdfConverter converter = new PdfConverter();<o:p></o:p>

converter.BindPdf(@"C:\AB\Test27\funny.pdf");

converter.StartPage = 1;

converter.EndPage = 1;

converter.DoConvert();

MemoryStream stream = new MemoryStream();

converter.GetNextImage(stream, ImageFormat.Jpeg);

using (BarCodeReader reader = new BarCodeReader(stream, BarCodeReadType.DataMatrix))

{

while (reader.Read())

{

Console.WriteLine("Symbol:" + reader.GetReadType() + " Code :" + reader.GetCodeText());

}

}

Result: Symbol:DataMatrix Code :Jimmy Test 1


I hope this will help you.