Pdf417
The Pdf417 is a two-dimensional barcode that can encode a large amount of text and data. DynamicBarcode Creator supports the Pdf417 barcode through its Pdf417 class.
Compaction
Compaction specifies the amount of data that can be compacted into codewords to save space. Pdf417 barcodes have three compaction modes: text, byte, and numeric.
- Text Compaction mode permits all printable ASCII characters to be encoded, i.e., values 32 - 126 inclusive per ISO/IEC 646 and selected control characters.
- Byte Compaction mode permits all 256 possible 8-bit byte values to be encoded. Byte compaction includes all ASCII characters value 0 to 127 inclusive and provides for international character set support.
- Numeric Compaction mode permits efficient encoding of numeric data strings.
DynamicBarcode Creator supports compaction through its Pdf417Compaction enumeration, which is provided as a Pdf417 constructor parameter or by setting the Compaction property directly.
Error Correction
By specifying an error correction level, you can prevent data loss for encoded data. A user may define one of 9 error correction levels (0 to 8). The following table lists the error correction codewords count for the selected error correction level.
Error Correction Level | Total Number of Error Correction Codewords |
---|---|
0 | 2 |
1 | 4 |
2 | 8 |
3 | 16 |
4 | 32 |
5 | 64 |
6 | 128 |
7 | 256 |
8 | 512 |
DynamicBarcode Creator supports setting the error correction level through the Pdf417ErrorCorrectionLevel enumeration, which can be set directly through a constructor in the Pdf417 class or by setting the ErrorCorrectionLevel property directly.
Simple Example
Creating a Pdf417 barcode is straightforward, as the following example illustrates.
Pdf417 barcode = new Pdf417("Hello World",3);
barcode.Draw(pngFilePath, 300, ImageFormat.Png);
Dim barcode As Pdf417 = New Pdf417("Hello World",3)
barcode.Draw(pngFilePath, 300, ImageFormat.Png)
This example accepts the default encoding and error correction. You can override the defaults by adding the appropriate values when constructing the Pdf417 instance, or you can set the values using the Pdf417 provided properties.