Hi, can anyone help me? I have some barcode in PDF document, and I'd like to decode these barcodes out. I searched in the google, and found many of others didn't do it well. How about your .net barcode reader SDK, support this?
---- Johnson
Hi, can anyone help me? I have some barcode in PDF document, and I'd like to decode these barcodes out. I searched in the google, and found many of others didn't do it well. How about your .net barcode reader SDK, support this?
---- Johnson
Hi, Johnson.
Our .NET Barcode Scanner control is usually able to read barcode from raster image files, such as .bmp, .png, .jpg and so on. If you want to read barcode from PDF document, maybe it's a little more complicated. You need use pqScan PDF to Image Library to convert PDF page to image first, and then decode the barcode from this image.
Before starting your .net application, you need download the free trial version of .NET Barcode Scanner SDK and .NET PDF to Image SDK. And then add the reference to your .net project in the Visual Studio. Now, all the preparation is done.
Here we provide steps of reading barcode from PDF using C# language. You can find in each step, the code is very simple.
using System; using System.Drawing; using PQScan.PDFToImage; using PQScan.BarcodeScanner; namespace BarcodeReaderQuestion { class Program { static void Main(string[] args) { //step 1: //convert PDF to image. PDFDocument pdf = new PDFDocument(); pdf.LoadPDF("sample.pdf"); //get first page to image Bitmap bmp = pdf.ToImage(0); //step 2: //scan barcode from image BarcodeResult[] results = BarCodeScanner.Scan(bmp); foreach (BarcodeResult result in results) { Console.WriteLine("barcode data:" + result.Data); Console.Write(" barcode type:" + result.BarType.ToString()); } } } }
Hope the C# code can be helpful.
---- pqScan Support Team
Copyright © pqScan 2010-2023. All Rights Reserved.