pdf-417

Details on the pdf-417 bar code type.

Pdf-417 can be used to encode text and binary data of variable length. It is possible to encode up to 925 code words (minimal error correction degree). Text, binary data and numeric data are compressed into code words so that the limits for these types are:

  • 1850 ASCII characters
  • 1108 Byte values
  • 2710 numeric values

The limits for mixed text are lower, as control characters are inserted to switch between the different compression modes.

Setting the error correction degree to the recommended minimum lowers the maximum number of encodable code words to 863 yielding these limits for the encodable types:

  • 1726 ASCII characters
  • 1033 Byte values
  • 2528 numeric values

The conversion of the data specified in the codeValue attribute to the internal representation is done by an algorithm that minimizes space (Sometimes there is more than one option to encode a particular piece of data). Non-ASCII characters are encoded using the specified encoding table. Byte values that cannot be represented in an XML document (for example all characters lower 0x20 except 0x9, 0xa and 0xd) can be represented by a backslash ('\') character followed by a 3 digit octal literal. The backslash character itself can be escaped by a sequence of two backslash characters.

These attributes (properties) are used by the pdf-417 bar code type:
  • Data Symbols per Line (dataSymbolsPerLine):
    • Type: Numeric.

    • The value must be an integer between 1 and 30. Low values cause more narrow printout with more lines. The number of lines is not allowed to exceed 90. It should be noted, that the overall required image space usually grows with lower values because there is a constant amount of organizational information which is added with each additional line. This is not generally the case, since lines have to be filled with padding so that specially with small amounts of data a larger value may actually create a larger image. If the value is not specified, the system computes a value that minimizes image space.

    • Fails if: Value cannot be parsed as a integer value. Value is not in the range 1...30.

    • Default value: A value that minimizes the overall image size.

  • Raw Code Value (rawCodeValue):
    • Type: String. The value must be a comma-separated list of integers in the range 0...899.

    • This attribute can be used instead of codeValue to specify the code value at a lower level giving more control on the encoded data.

    • Fails if: Encoding for non-ASCII characters in the code value.

    • Default value: not set

  • Error Correction Degree (errorCorrectionDegree):
    • Type: Numeric. The value must be an integer.

    • The Error Correction Degree property specifies the error correction degree.

      Valid values are in the range 0...8. Higher values make the image more robust.

    • Fails if: Value cannot be parsed as a integer value. Value is not in the range 0...8.

    • Default value: A value that proportional to the data size.

  • Encoding (encoding):
    • Type: String.

    • The Encoding property sets the encoding for non-ASCII characters in the code value.

      Run "java CharsetInfo" for a list of character set encodings available on a particular platform. Valid example values are ISO-8859-15 or IBM437.

    • Fails if: The specified encoding is not in the list of encodings returned by the java CharsetInfo command.

    • Default value: not set (the lower 8 bits of the unicode values are encoded)