Scan, read Macro PDF417 barcodes using C# code

Top
Macro PDF417 provides a mechanism for the data in a file to be split into blocks and be represented in more than one PDF417 symbol. This mechanism is similar to the Structured Append feature in other symbologies, like Data Matrix, QR Code.
Each Macro PDF417 symbol shall contain additional control information to enable the original data file to be properly reconstructed, irrespective of the sequence in which the individual PDF417 symbols are scanned and decoded.
Here are list of important properties of Macro PDF-417 barcode
- File id: all Macro PDF417 barcode with the same file id are the parts of the same data message
- Segment index: it is the order of the data message. The first segment index is 0
- Is the last segment: It is to know whether the current PDF417 is the last segment or not.
The steps and C# source code below show how to get the information of Macro PDF417 barcodes using C#.NET Barcode Reader library
- Utilize BarcodeScanner.ScanInDetails() to get all PDF 417 barcode information from an existing image file
- For each scanned PDF417 barcode, you will get
- Is it a Macro PDF417 barcode using BarcodeDetail.isMacroPDF417()
- Get Macro PDF417 file id using BarcodeDetail.getMacroPDF417FileID()
- Is it the last segment of Macro PDF417 using BarcodeDetail.isMacroPDF417LastSegment()
- Get Macro PDF417 segment index (the first segment index is 0) using BarcodeDetail.getMacroPDF417SegmentIndex()
- Extract Macro PDF417 data using BarcodeDetail.Data
public static void ReadMacroPDF417()
{
String imageFilePath = "...";
// scan all PDF417 symbols in the image file
BarcodeDetail[] datas = BarcodeScanner.ScanInDetails(imageFilePath, BarcodeType.PDF417);
for (int j = 0; j < datas.Length; j++)
{
// check if this is a Macro PDF417
Console.WriteLine(" Is Macro PDF417: " + datas[j].isMacroPDF417());
// get macro PDF 417 file id
Console.WriteLine(" File id: " + datas[j].getMacroPDF417FileID());
// check if this is the last segment
Console.WriteLine(" Is Last Segment: " + datas[j].isMacroPDF417LastSegment());
// get segment number (in String type)
Console.WriteLine(" Segment Index: " + datas[j].getMacroPDF417SegmentIndex());
// get file ID (in String type)
// Note:
// All characters in this String is digital ASCII (that is 0 ~ 9)
// Every 3 digits represent a number (which based on 900)
Console.WriteLine(" File ID: " + datas[j].getMacroPDF417FileID());
if (datas[j].isMacroPDF417())
{
// get data in the Macro PDF417
string barcodeSegmentData = datas[j].Data;
// ...
}
}
}
PDF417 is a high density, two-dimensional stacked barcode format used in a variety of applications,
such as driver's license, airline boarding pass, transport, and inventory management.
You use OnBarcode C# Barcode Reader SDK to scan and decode text from PDF417 barcode images in C# ASP.NET, Windows application.
How to scan PDF417 barcode image?
You can use camera with app installed on smartphone, or barcode scanner device or software to scan, read PDF417 barcodes.
C# Barcode Scanner library enables you to quickly integrate PDF417 barcode reading feature in C# ASP.NET, Windows Forms, WPF web and Windows applications.
Can iPhone or Android phones scan PDF417 barcode?
With OnBarcode best-in-class C# PDF417 scanner, you can scan PDF417 codes with iPhone or Android mobile devices.
What is the difference between a PDF417 and a QR Code?
Both PDF417 and QR Code are two-dimensional (2D) barcode formats. PDF417 can be scannable even if up to 50% of it is damaged. QR Code can accept up to 30% damages.
C# Barcode Scanner library supports both PDF417 and QR Code 2d barcode reading and recognition.