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:
  • dataSymbolsPerLine (Data Symbols per Line):
    • Type: Integer value.

    • 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.

  • rawCodeValue (Raw Code Value):
    • Type: 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

  • errorCorrectionDegree (Error Correction Degree):
    • Type: Integer value.

    • The errorCorrectionDegree 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: Encoding

    • 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:
      • Value is not a valid host name
      • Socket connection cannot be established
    • Default value: not set (the lower 8 bits of the unicode values are encoded)