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

Free Support Forum - aspose.com

Decoding Bar Code in a Document

I’ve just finished looking at all barcode examples in “Aspose Barcode Java Master”. Very interesting examples. Well done.

Do you have any example showing how to decode a bar code anywhere in a scanned document/pdf?

I intend to print the bar code (up to here, it’s easy) and then ask the user to provide a scanned version of the printed document. I would like to decode the bar code located probably in the corner of the scanned document.

Kind regards
JP (Using Renato’s account).

Hi Renato,

Thank you for contacting support. Please note that Aspose.BarCode API takes image file format and recognize codes from it. It supports recognizing multiple codes. It works well with barcode recognition. In case, you have a barcode in the PDF document, then you can use Aspose.Pdf API to get barcode image. There could be multiple approaches, e.g. extract images from the PDF file or convert each page of PDF file to thumbnail. Finally, pass these barcode images to Aspose.BarCode API. Please refer to the help topic there: How to Read Barcode from PDF Documents

One more thing, you can cut the part where bar code resides if some placement rules are exists for bar code image i.e. top right corner. This can significantly speed up the processing as we will have to process only a small portion of the image. Please find the required source code in the following help topic:
Read Barcode from Specific Region of Image

We hope, this helps. Please feel free to reply us in case of any confusion or questions.