Aspose.PDF for .NET is very powerful product for managing PDF documents. It makes it easy to convert pages in PDF documents to images. Aspose.BarCode for .NET is an equally powerful product for generating and recognizing barcodes.
PdfConverter under the
Aspose.PDF.Facades namespace supports converting PDF pages to various image formats. The
PngDevice under the
Aspose.PDF.Devices namespace supports converting PDF pages to PNG files. Either of these classes can be used to transform pages of PDF file into images.
When the pages have been converted to an image format, we can use Aspose.BarCode for .NET to identify barcodes inside them. The code samples below show how to convert pages using either
PdfConverter class contains a method named
GetNextImage which generates the an image from the current PDF page. To specify the output image format, this method accepts an argument from the
Aspose.Barcode contains a namespace,
BarCodeRecognition, which contains the
BarCodeReader class. The
BarCodeReader class lets you read, determine, and identify barcodes from image files.
For the purposes of this example, first convert a page in a PDF file into an image with
Aspose.PDF.Facades.PdfConverter. Then use the
Aspose.BarCodeRecognition.BarCodeReader class to recognize the barcode in the image.
Using the PngDevice Class
Aspose.PDF.Devices, is the
PngDevice. This class lets you convert pages in PDF documents to PNG images.
For the purpose of this example, load the source PDF file into the
Document object and use the
PngDevice class to transform the input document's pages into PNG images. When the images have been created, use the
BarCodeReader class under the
Aspose.BarCodeRecognition to identify and read barcodes in the images.