In the download package of our barcode scanner software for .NET, you may find a DLL library called PQScan.BarcodeScanner.dll. This .NET assembly can be used in C# and VB.NET PDF-417 barcode recognition applications. To use this software in your .NET windows or web project, Visual Studio 2005+ and .NET Framework 2.0+ should be installed on your computer.
Using this .NET barcode reader component for PDF-417, various 2D barcode decoding features can be implemented in your Visual C# and Visual Basic .NET projects. For instance, you can easily read PDF-417 2D barcode from Jpeg, Jpg, Png, Gif, Bmp, Tiff, and Tif image files; you can also recognize PDF-417 from PDF document. Moreover, you are able to customize the way of barcode recognition, scanning only PDF417 bar code or all barcode types from loaded image source.
The following two parts will respectively illustrate how to scan and decode PDF417 barcode from image file using free C# sample code and VB.NET sample code, no matter wherever the barcode position in the image.
C# Sample: Scan PDF-417 from Image
The following free Visual C# sample code only depicts how to scan PDF-417 barcode symbol from an image file on your local disk. You may also find related APIs for reading PDF-417 from a bitmap or stream of image source. In this C# coding example, PDF417 is defined as the target barcode type so that only this barcode type will be decoded from your image file.
public void ScanPDF417FromFile(string filename)
// Set PDF417 as the target barcode symbol and decode them all from an image file.
BarcodeResult results = BarCodeScanner.Scan(filename, BarCodeType.PDF417);
// APIs for reading PDF417 from Bitmap and Stream of image.
// public static BarcodeResult Scan(Bitmap bitmap, BarCodeType barType);
// public static BarcodeResult Scan(Stream stream, BarCodeType barType);
foreach (BarcodeResult result in results)
Console.WriteLine(result.BarType.ToString() + "-" + result.Data);
VB.NET Sample: Scan PDF-417 from Image
With the help of .NET Barcode Reader Component, VB.NET users are empowered to read all barcode types including PDF-417 font from loaded image file. And the scanning result will be the form of data array, including barcode type and barcode text data information. The following VB.NET sample code can be copied to implement this function at fast speed.
Public Sub ScanAllFromFile(ByVal filename As String)
' VB.NET sample code for reading all barcode symbols from an image file.
Dim results() As BarcodeResult = BarCodeScanner.Scan(filename)
' VB.NET APIs for scanning all barcode types from Bitmap and Stream of image.
' public static BarcodeResult Scan(Bitmap bitmap)
' public static BarcodeResult Scan(Stream stream)
Dim result As BarcodeResult
For Each result In results
Console.WriteLine(result.BarType.ToString() + "-" + result.Data)
Please note that, if you want to recognize PDF417 bar code from PDF file, you should firstly use our .NET PDF to Image Converter Library to convert PDF to image file, and then use .NET Barcode Decoder Library to decode barcodes from rendered image file.