Prices from: $ 587.02

Aspose.BarCode for .NET Forum

Aspose.BarCode adnan_raf [USA] 24-Aug-2007 10:24:44

Can i read barcode from pdffile using the .net managed component? if yes then point be to some url and if no then what i need to do...?

Many thanks, adnan

RE: Aspose.BarCode shahzad.latif [Pakistan] 09-May-2012 19:23:32

Hi Adnan,

In order to read bar code from PDF file, you'll have to use two components: Aspose.Pdf (to extract bar code image from PDF), Aspose.Barcode (to read barcode from barcode image). You can use the following code to achieve your goal:

// set the license for Aspose.BarCode for .NET and Aspose.Pdf for .NET components
Aspose.BarCodeRecognition.License licenceBarCodeRecognition = new Aspose.BarCodeRecognition.License();

Aspose.Pdf.License licensePdf = new Aspose.Pdf.License();

// bind the pdf document
PdfExtractor pdfExtractor = new PdfExtractor();
// set page range for image extraction
pdfExtractor.StartPage = 1;
pdfExtractor.EndPage = 1;
// extract the images
Console.WriteLine("Extracting images.....");
// save images to stream in a loop
while (pdfExtractor.HasNextImage())
Console.WriteLine("Getting next image....");
// save image to stream
MemoryStream imageStream = new MemoryStream();
imageStream.Position = 0;

Console.WriteLine("Recognizing barcode....");
// recognize the barcode from the image stream above
BarCodeReader barcodeReader = new BarCodeReader(imageStream, BarCodeReadType.Code39Standard);
Console.WriteLine("Codetext found: " + barcodeReader.GetCodeText() + ", Symbology: " + barcodeReader.GetReadType().ToString());
// close the reader
catch (Exception ex)

If you need any further help, please do let us know.

Back to Aspose.BarCode for .NET

Official Supplier

Official Supplier

As official and authorized distributors, we supply you with legitimate licenses directly from 300+ software publishers.

See all our Brands.

24/5 Customer Service

24/5 Customer Service

Need help to find the right software license, upgrade or renewal?

Call, Email or Live Chat with our experts.

Trusted for 20 Years

Trusted for 20 Years

Over 580,000 licenses delivered to Developers, SysAdmins, Corporations, Governments & Resellers, worldwide.

Read more about us.