Skip to footer content

How to Read Barcodes From PDFs in C#

Unlock the power of efficient barcode extraction from PDF documents by watching our tutorial, and master the IronBarcode library to streamline your data retrieval process today!

In this tutorial, we explore how to read barcodes in PDF documents using the IronBarcode library from Iron Software. Assuming you have IronBarcode installed, we begin by including its namespace in our program. We then create a list of integers to indicate the PDF pages we wish to scan for barcodes, selecting pages one, two, and three. Next, we instantiate the PDFBarcodeReaderOptions class, passing our page list to the constructor while setting the DPI to 150 to adjust resolution and the scale to 3.5 for barcode size. Other settings include setting the reading speed to 'detailed' for precision, specifying expected barcode types as QR codes, and allowing detection of multiple barcodes within the PDF. To perform the barcode reading, we use the ReadPDF method, providing the path to the PDF and our configured options. The program loops through the detected barcodes, printing each unique barcode to the console. This feature is highly useful for efficiently extracting barcode data from PDF documents. The tutorial concludes with an encouragement to explore Iron Software's trial subscription for further insights.

Further Reading: How to read Barcodes from PDF Documents

Related Videos