Reading PDF-417 barcodes from scanned images
PDF-417 barcodes are a common type of 2-D barcode and are designed to store more data than a 1-D barcode with built in redundancy and error correction. A PDF-417 barcode actually consists of stacks of 1-D barcodes arranged in columns. Each of the 1-D barcodes is called a cluster and has a numeric value. The barcode shown below is a typical example – it has 4 columns and each column contains 12 clusters.
Some of the clusters contain information about the structure of the barcode or the row number, some are used for error correction and the rest hold the data. PDF-417 barcodes can be encoded with different levels of error correction – higher levels give better resillience against damage but also need more clusters and so can lead to larger, more complex barcodes.
When a PDF-417 barcode is scanned at a low resolution it becomes harder for barcode scanning software to calculate the value for each cluster, which means that more error correction needs to be done. After a certain point it will not be possible to error correct and a barcode will fail to read. In a batch of PDF-417 barcodes scanned at a low resolution there will be some that read ok and others than will not.
As a general rule it is best to ensure that each column of a PDF-417 barcode occupies at least 50 pixels in the scanned image and preferably around 70 pixels. It’s also a good idea to avoid encoding any more data than is stricly necessary and to use the highest error correction level possible without impacting on the size of the barcode.