Free Support Forum - aspose.com

Barcode scanning performance

I have written a couple of test harnesses that scan for barcodes in both (1) .pdf and (2) .tif files. In my tests, the average time to scan a 6 page .pdf is anywhere from 15-20 seconds. .tif files scan in about a third of the time.

My question is, is there any way to optimize barcode scanning?

Can I limit the barcode search to certain regions of a page (as in force the barcode to always be in the top-left part of the page, and therefore only need to search in the top left part of the page)?

Thanks for your help on this.

Hi,


Thank you for inquiry.

Yes, you can restrict the barcode reader to read from specific region (rectangular area). Please refer to http://www.aspose.com/documentation/.net-components/aspose.barcode-for-.net/read-barcode-from-specific-region-of-image.html for documentation and sample code.

Since you are reading a PDF document, it takes more time to first extract images and then read the barcode from these extracted images.

So there is nothing I can do to speed up the process of reading directly from a .pdf?

Reading from a PDF document is actually a two step process.

  1. Use Aspose.Pdf.Kit for .NET to load extract images
  2. Use Aspose.BarCode for .NET to read the barcodes from the images extracted from step 1
You may refer to the sample code and documentation from http://www.aspose.com/documentation/.net-components/aspose.barcode-for-.net/recognize-barcode-from-pdf-document.html.

Regarding barcode recognition performance, one method is to specify the area inside the image, where the barcode reader should look for barcodes. You may also try other methods mentioned http://www.aspose.com/documentation/.net-components/aspose.barcode-for-.net/optimized-scan.html and http://www.aspose.com/documentation/.net-components/aspose.barcode-for-.net/better-and-faster-image-processing-for-barcode-recognition.html.

Setting suitable values for GrayScale, ScanStrength and Threshold hints may also improve the recognition performance.