Page 1 of 1

Problems with QR-Code Recognition

Posted: Tue Sep 18, 2012 9:55 am
by DavideBak
Hello, I've some problems with QR-Code Barcode Recognition Plugin.

This is my PDF that contains 4 barcodes and this is my code that read barcodes.
In same case GDPicture recognizes 3 barcode (the 4th is too small but this is not my problem) and in others it recognizes 0 barcodes.

Code: Select all

GdPicturePDF gdPicPdf = new GdPicturePDF();
gdPicPdf.SetLicenseNumber(BarcodeResource.SERIAL_GDPICTURE);

Document doc = new Document();

if (File.Exists(fileSource))
{
	if (gdPicPdf.LoadFromFile(fileSource, false) == GdPictureStatus.OK)
	{
		for (int iPage = 1; iPage <= gdPicPdf.GetPageCount(); iPage++)
		{
			Page pg = new Page();
			
			gdPicPdf.SelectPage(iPage);
			imageId = gdPicPdf.RenderPageToGdPictureImage(dpi, false);

			if (imageId != 0)
			{
				GdPictureImaging gdPicImage = new GdPictureImaging();
				gdPicImage.BarcodeQRReaderDoScan(imageId, BarcodeQRReaderScanMode.BestQuality);			
				gdPicImage.ReleaseGdPictureImage(imageId);

				for (int iBarcode = 1; iBarcode <= gdPicImage.BarcodeQRReaderGetBarcodeCount(); iBarcode++)
					pg.AddQRCode(new QRCode(gdPicImage.BarcodeQRReaderGetBarcodeValue(iBarcode)));
					
				doc.AddPage(pg);
					
				gdPicImage.BarcodeQRReaderClear();
                gdPicImage.Dispose();
			}
		}
	}
}

NOTE : Document, Page and QRCode are my custom Objects
It's a bug on my code?

Thank in advance,
Davide

Re: Problems with QR-Code Recognition

Posted: Tue Sep 18, 2012 10:32 am
by SamiKharma
Hi,

I guess by "some cases" you mean under different dpi. Please run the barcode recognition demo, it will render the page to 200 dpi (least allowed for barcode recognition in GdPicture). It will recognize all three barcodes. The fourth carries some corrupted data.
I suggest you try to mimic the barcode recognition demo.

Best,
Sami

Re: Problems with QR-Code Recognition

Posted: Tue Sep 18, 2012 12:11 pm
by DavideBak
No. Even if originally PDF is rendered with 200 dpi, or more, in some case (it's random) the recognition fails.

The fourth barcode has no corrupted data, but contains a string converted to base64.