PDF417, or Portable Data File 417,
is a two-dimensional stacked barcode symbology capable of encoding over a
kilobyte of data per label. It was developed by Symbol Technologies (1989-1992)
and is currently maintained by ANSI / AIM USA.
Large amounts of text and data can be stored securely and inexpensively when
using the PDF417 symbology. The printed symbol consists of several linear rows
of stacked codewords. Each codeword represents 1 of 929 possible values from
one of three different clusters. A different cluster is chosen for each row,
repeating after every three rows.
PDF417 is a bar code symbology with the following basic characteristics:
Encodable character set:
Text Compaction mode permits all printable ASCII characters to be encoded, i.e. values 32 - 126 inclusive in accordance with ISO/IEC 646 (IRV), as well as selected control characters.
Byte Compaction mode permits all 256 possible 8-bit byte values to be encoded. This
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.
Up to 811 800 different character sets or data interpretations.
Various function codewords for control purposes.
Symbol character structure: (n, k, m) characters of 17 modules (n), 4 bar and 4 space elements (k), with
the largest element 6 modules wide (m).
Maximum possible number of data characters per symbol (at error correction level 0): 925 data
codewords which can encode:
Text Compaction mode: 1 850 characters (at 2 data characters per codeword).
Byte Compaction mode: 1 108 characters (at 1,2 data characters per codeword).
Numeric Compaction mode: 2 710 characters (at 2,93 data characters per codeword)
At the minimum recommended error correction level, there is a maximum of 863 data codewords which
can encode:
Text Compaction mode: 1 726 characters (at 2 data characters per codeword).
Byte Compaction mode: 1 033 characters (at 1,2 data characters per codeword).
Numeric Compaction mode: 2 528 characters (at 2,93 data characters per codeword).
Symbol size:
Number of rows: 3 to 90.
Number of columns: 1 to 30.
Width in modules: 90X to 583X including quiet zones.
Maximum codeword capacity: 928 codewords.
Maximum data codeword capacity: 925 codewords.
Since the number of rows and the number of columns are selectable, the aspect ratio of a PDF417 symbol
may be varied when printing to suit the spatial requirements of the application.
Selectable error correction: 2 to 512 codewords per symbol
Non-data overhead:
Per row: 73 modules, including quiet zones.
Per symbol: a minimum of 3 codewords, represented as symbol characters.
There are two ways to create barcode images in your Java web applications.
This is the simplest way to stream barcode image using our provided barcode servlet classes.
And it will not save barcode images in your server side.
Under demo package, copy barcode folder to your java servlet container like tomcat.
To test your installation, goto http://YourDomain:Port/barcode/pdf417?Data=123456789
To create barcode image in your JSP or html page, you can pass the url to IMG tag src value.
For example, <img src="http://YourDomain:Port/barcode/pdf417?Data=123456789" />
The second method is similar with the way to generate barcode in Java applications.
Set the data property with the value to encode. Type is String.
Servlet Parameter: "Data".
Set the dataMode property. Default is PDF417.Text.
PDF417.AUTO: Barcode Library will use the different compaction modes and switching procedures automatically.
PDF417.MODE_BYTE: It allows encoding all 256 possible 8-bit byte values. This
includes all ASCII characters value from 0 to 127 inclusive and provides for
international character set support
PDF417.MODE_TEXT (default): It allows encoding all printable ASCII characters, i.e. values
from 32 to 126 inclusive in accordance with ISO/IEC 646, as well as selected
control characters such as TAB (horizontal tab ASCII 9), LF (NL line feed, new
line ASCII 10) and CR (carriage return ASCII 13)
PDF417.MODE_NUMERIC: It allows encoding numeric data.
Servlet Parameter: "DataMode".
Set the ecl property. PDF417 Error Correction Level.
Default is PDF417.ECL_2 (2).
Servlet Parameter: "ECL".
Set the truncated property to true, if you want truncated PDF417.
Default is false. truncated PDF417 may be used where space considerations are a primary concern and symbol damage is unlikely.
Servlet Parameter: "Truncated".
Set the column property value.
Number of columns. The value range is from 1 to 30. The default is 5. Increase this value, if your data size is large.
Servlet Parameter: "ColumnCount".
Set the row property value.
The number of rows for PDF417. The value range is from 3 to 90. The default is 3.
Servlet Parameter: "RowCount".
Macro PDF 417
PDF 417 can be divided into multiple data areas, also called Macro PDF 417. Conversely, information stored in multiple PDF417 symbols can be reconstructed as single data symbols.
Set
isMacro property to true, then Macro PDF417 is enabled.
Servlet Parameter: "IsMacro".
Set
macroSegmentCount property to the number of total symbols which make the sequence.
Servlet Parameter: "MacroSegmentCount".
Set
macroSegmentIndex property to the position of current symbol in the secuence (Start with 0).
Servlet Parameter: "MacroSegmentIndex".
Set
macroFileIndex property to be identified to the same file .
Servlet Parameter: "MacroFileIndex".
Setting up barcode image size:
Set property uom (Unit of Measure) for properties barWidth, leftMargin, rightMargin, topMargin and bottomMargin.
Default is PDF417.UOM_PIXEL (0). Valid values are PDF417.UOM_PIXEL (0), PDF417.UOM_CM (1), PDF417.UOM_Inch (2).
Servlet Parameter: "UOM".
Set the X (for barcode module width, type is float, default is 1) and barRatio (type int, barcode module height = X * barRatio, default is 3).
Servlet Parameter: "X", "BarRatio".
Set the leftMargin, rightMargin, topMargin and bottomMargin properties.
Types are all float. Default are 5 * X.
Servlet Parameter: "LeftMargin", "RightMargin", "TopMargin", "BottomMargin".
Set the barcodeWidth (barcode image width) and barcodeHeight (barcode image height) properties. Both types are float.
Servlet Parameter: "BarcodeWidth", "BarcodeHeight".
Set the resolution property (Value is expressed in DPI - Dots per inch).
Servlet Parameter: "Resolution".
Set rotate property, if you want to rotate barcode image.
Value can be 0 (PDF417.ANGLE_0),
1 (PDF417.ANGLE_90),
2 (PDF417.ANGLE_180),
3 (PDF417.ANGLE_270)
Servlet Parameter: "Rotate".
Set the processTilde property to true, if you want use the tilde character "~" to specify special characters in the input data. Default is false.
~NNN: is used to represent the ASCII character with the value of NNN. NNN is from 000 - 255.
Servlet Parameter: "ProcessTilde".
To set barcode image width and height, there are two ways to do it.
1) You can set barcode image width and height through properties barcodeWidth and barcodeHeight values, barcode library will render the barcode image for you.
or
2) You can set X (barcode module width) and barRatio (barcode module height = X * barRatio) values, barcode library will calculate the barcodeWidth and barcodeHeight values for you, and render the barcode image.