The component is used to create the PDF417 Barcode symbols. It is defined in the pPDF417 unit.
PDF417 is a continuous, stacked 2D linear barcode symbol format used in a variety of applications, primarily transport, identification cards, and inventory management. PDF stands for Portable Data File. It can encode all 8-bit values.
The PDF417 symbology was invented by Dr. Ynjiun P. Wang at Symbol Technologies in 1991.
Each PDF417 symbol consists of a stack of vertically aligned rows with a minimum of 3 rows (maximum 90 rows). Each stacked row shall include a minimum of 1 symbol character column (maximum 30 symbol character columns), excluding start, stop and row indicator columns. They are defined in the pPDF417Custom unit. The RowHeight property can be used to specify the height for each stacked row, in modules. See diagram:
You can use the MinRows and the MaxRows properties to specifiy the minimum and maximum number of stacked rows for a PDF417 symbol. And use the MinColumns and the MaxColumns properties to specifiy the minimum and maximum number of symbol character columns for it. In other words, the MinRows and MinColumns properties specify a minimum symbol size, and the MaxRows and MaxColumns properties specify a maximum symbol size. According to the priority order specified by the StretchOrder property, the first symbol size that accommodates the barcode text will be automatically selected between the minimum symbol size and the maximum symbol size.
You can use the CurrentRows property to get the factual number of stacked rows. And use the CurrentColumns property to get the factual number of columns.
If the barcode text is so long that it cannot be encoded using the maximum symbol size specified by the MaxRows and the MaxColumns properties, an OnInvalidLength or OnInvalidDataLength (only for Delphi/C++ Builder 2009 or later) event will occur.
The symbol shall include a quiet zone on all four sides. The minimum quiet zone is equal to 4 modules on all four sides. So the minimum values of LeadingQuietZone, TrailingQuietZone, TopQuietZone, and BottomQuietZone properties are equal to 4.
PDF417 symbols offer 9 levels of error correction, referred to as ECC 0 to ECC 8 respectively in increasing order of recovery capacity. You can use the ECCLevel property to specify the error correction code level for a PDF417 symbol. It can be one of values from elEcc_0 to elEcc_8, corresponding to error correction code level from ECC 0 to ECC 8. They are defined in the pPDF417Custom unit.
If the ECCLevelUpgrade property is set to true, the highest error correction code level that can be accommodated by current symbol size will by used for creating more robust symbols. Note, the new level is always no lower than the level specified by the ECCLevel property, and the symbol size will not be increased, it may be determined based on the length of barcode text, and the error correction code level specified by the ECCLevel property, in other words, only the remaining capacity in current symbol size will be used to upgrade the error correction code level. The CurrentECCLevel property can be used to get the factual error correction code level.
All 8-bit values can be encoded. The default interpretation shall be:
This interpretation corresponds to ECI 000003.
PDF417 has three unique data compaction modes as Text compaction mode, Numeric compaction mode, and Byte compaction mode. All 8-bit values are encoded by switching internally between all 3 compaction modes:
Text compaction mode: Permits all printable ASCII characters, i.e. ASCII values from 32 to 126 inclusive accordance with ISO/IEC 646, as well as selected control characters (CR, HT, and LF).
The mode has four sub-modes:
The sub-mode will be switched automatically in order to minimize the symbol size.
Numeric compaction mode: Permits efficient encoding of numeric data string.
Byte compaction mode: Permits all 256 possible 8-bit byte values to be encoded. This includes all ASCII characters value from 0 to 127 inclusive and provides for international character set support.
The compaction mode will be switched automatically in a PDF417 symbol in order to minimize the symbol size. Also, you can manually switch the code set by using escape sequences "\900", "\901", "\902", and "\924". See also the "Escape sequences" section below.
The FNC1 characters can be encoded for compatibility with some existing applications. There are two mode FNC1 characters to identify symbols encoding messages formatted according to specific predefined industry or application specifications, also the FNC1 character can be used as the data field separator:
First position mode: FNC1 in this mode indicator identifies symbols encoding data formatted according to the GS1 Application Identifiers standard. For this purpose, it shall only be used once in a symbol and shall be placed at beginning of the barcode text.
If any one of escape sequences in "\903", "\904" and "\905" followed by an Application Identifier (2 or more digits) is placed at beginning of barcode text, it represents a leading FNC1 character in "First position" mode, and implies a mode latch to Text compaction mode or Numeric compaction mode. See also the "Escape sequences" section below.
Also, you can place an escape sequence "\f" followed by an Application Identifier (2 or more digits) at beginning of barcode text instead of the "\903", "\904" or "\905" escape sequence followed by the Application Identifier, to place the FNC1 character in "First position" mode. The component will automatically select one of escape sequences from "\903", "\904" and "\905" depending on the barcode text, in order to minimize the symbol size.
The escape sequences "\906", "\907", "\912", "\914" and "\915" can be placed the FNC1 character in "First position" mode too. See also the "Escape sequences" section below.
Second position mode: FNC1 in this mode indicator identifies symbols formatted in accordance with specific industry or application specifications previously agreed with AIM International. It is immediately followed by an application indicator assigned to identify the specification concerned by AIM International. For this purpose, it shall only be used once in a symbol and shall be placed at beginning of the barcode. An application indicator may take the form of any single Latin alphabetic character from the set "a" to "z" and "A" to "Z", or a two-digit number.
If any one of escape sequences in "\908" and "\909" followed by an application indicator (single Latin alphabetic character from the set "a" to "z" and "A" to "Z", or a two-digit number) is placed at beginning of barcode text, it represents a leading FNC1 character in "Second position" mode, and implies a mode latch to Text compaction mode or Numeric compaction mode. See also the "Escape sequences" section below.
Data field separator: The FNC1 character may also be used as a data field separator (i.e. at the end of a variable-length data field), in which case it will be represented in the transmitted message as GS character (ASCII value 29). The data field separator shall not be placed at beginning of barcode text.
If any one of escape sequences in "\903", "\904" and "\905" is placed in the barcode text, but not at beginning of the barcode text, it represents a data field separator, and implies a mode latch to Text compaction mode or Numeric compaction mode. See also the "Escape sequences" section below.
Also, you can use the escape sequence "\f" instead of the "\903", "\904" or "\905" to placed the FNC1 character as the data field separator. The component will automatically select one of escape sequences from "\903", "\904" and "\905" depending on the barcode text, in order to minimize the symbol size.
The appearance of an adjacent pair of repeated "\903", "\904" or "\905" escape sequences will cause the decoder to divide the transmission at that point (but without transmitting the two implied GS (ASCII value 29) characters themselves).
The ECI indicator blocks can be encoded for the standardized encoding of message interpretation information. The escape sequence "\e[<ECI_Numnerm>]" can be used to place the ECI indicator block to barcode text. See also the "Extended Channel Interpretation (ECI)" section below.
If the AllowEscape property is set to true, following escape sequences are supported by the component, you can insert them to the barcode text:
\\: Insert a backslash to barcode text.
\5: Insert a 05 macro to barcode text. It's used to abbreviate the industry specific header "[)>{RS}05{GS}" and trailer "{RS}{EOT}", in order to reduce the size of symbol. It must only be placed once at beginning of the barcode text and it shall not be used in Macro PDF417 symbols.
\6: Insert a 06 macro to barcode text. It's used to abbreviate the industry specific header "[)>{RS}06{GS}" and trailer "{RS}{EOT}", in order to reduce the size of symbol. It shall only be placed once at beginning of the barcode text and it shall not be used in Macro PDF417 symbols.
\r: Instructs the reader to interpret the data contained within the PDF417 symbol as programming for reader initialisation. It shall only be placed once at beginning of the barcode text. In the case of a Macro PDF417 initialisation sequence, it shall appear in every symbol.
\e[<ECI_Numnerm>]: Insert an ECI indicator block to barcode text. See also the "Extended Channel Interpretation (ECI)" section below.
\f: Insert a FNC1 character either in "First position" mode or as a data field separator, to the barcode text. One of "\903", "\904", and "\905" will be automatically selected instead of the "\f", to insert to the symbol, depending on the barcode text. If it's placed at beginning of barcode text, it represents a FNC1 character in "First position" mode, otherwise, it represents a data field separator. See also the "Character set" section above.
Note, When the "poFirstFNC1MatchAI01" is included in the value of Options property, if the "\f" followed by a SSC-14 number (including Application Identifier 01 and 13-digit data, the checkdigit isn't required) is placed at beginnig of barcode, the "\905" will be selected to encode the FNC1 character in order to reduce the symbol size (the leading Application Identifier 01 is not encoded in the SSC-14 number).
\s[<Index>, <File_ID>, <File_Name>, <Amount>, <Time_Stamp>, <Sender>, <Address>, <File_Size>, <Checksum>]: Insert additional control information to barcode text in order to create the Marco PDF417 symbol. See also the "Macro PDF417" section below.
\,: Insert a comma to File name, Sender or Address field of the Marco PDF417 control information. It shall only be placed in these fields of Marco PDF417 control information. See also the "Macro PDF417" section below.
\t: Marco PDF417 terminator. If the segment count is unused in the control information of a Marco PDF417 symbols set, this terminator is required in last symbol within the set of the Marco PDF417 symbols. Otherwise, it's optional. See also the "Macro PDF417" section below.
\<nnn>: Insert a function codeword. This "<nnn>" can be one of these values:
900: Manually places a mode latch to Text compaction mode.
901: Manually places a mode latch to Byte compaction mode. It shall be used when the total number of subsequent bytes to be encoded is not a multiple of 6, otherwise, it will be change to "\924" automatically by the component.
902: Manually places a mode latch to Numeric compaction mode.
903: If it's placed at beginning of barcode text, it represents a leading FNC1 character in "First position" mode and indicates that the PDF417 symbol's data output shall conform with the Code128 specification (UCC/EAN-128 emulation, the symbology identifier prefix is set to ]C1 or ]L3). Also it implies a mode latch to Mixed sub-mode of Text compaction mode.
If it's placed in the barcode text, but not at beginning of the barcode text, it represents an FNC1 character as field separator, and implies a mode latch to Alpha sub-mode of Text compaction mode.
904: If it's placed at beginning of barcode text, it represents a leading FNC1 character in "First position" mode and indicates that the PDF417 symbol's data output shall conform with the Code128 specification (UCC/EAN-128 emulation, the symbology identifier prefix is set to ]C1 or ]L3). Also it implies a mode latch to Numeric compaction mode.
If it's placed in the barcode text, but not at beginning of the barcode text, it represents an FNC1 character as field separator, and implies a mode latch to Mixed sub-mode of Text compaction mode.
905: If the "\905" followed by 13 required digits is placed at beginning of barcode text, it represents a leading FNC1 character in "First position" mode and encodes a SCC-14 number together with subsequent 13 digits (the Application Identifier 01 is implied and the last checkdigit isn't required). It indicates that the PDF417 symbol's data output shall conform with the Code128 specification (UCC/EAN-128 emulation, the symbology identifier prefix is set to ]C1 or ]L3). Also it implies a mode latch to Numeric compaction mode.
If the it is placed in the barcode text, but not at beginning of the barcode text, it represents an FNC1 character as field separator, and implies a mode latch to Numeric compaction mode.
906: It represents a leading FNC1 character in "First position" mode and implies a mode latch to Mixed sub-mode of Text compaction mode. It not only indicates that the PDF417 symbol's data output shall conform with the Code128 specification (UCC/EAN-128 emulation, the symbology identifier prefix is set to ]C1 or ]L3), but also indicates that a linear symbol printed below the symbol is "linked" to the data of the symbol.
The escape sequence shall only be placed once at beginning of barcode text, otherwise an OnInvalidChar or OnInvalidDataChar (only for Delphi/C++ Builder 2009 or later) event will occur.
907: It represents a leading FNC1 character in "First position" mode and implies a mode latch to Numeric compaction mode. It not only indicates that the PDF417 symbol's data output shall conform with the Code128 specification (UCC/EAN-128 emulation, the symbology identifier prefix is set to ]C1 or ]L3), but also indicates that a linear symbol printed below the symbol is "linked" to the data of the symbol.
The escape sequence shall only be placed once at beginning of barcode text, otherwise an OnInvalidChar or OnInvalidDataChar (only for Delphi/C++ Builder 2009 or later) event will occur.
908: The "\908" followed by an application indicator (single Latin alphabetic character from the set "a" to "z" and "A" to "Z", or a two-digit number) represents a leading FNC1 character in "Second position" mode, and indicates that the PDF417 symbol's data output shall conform with the Code128 specification (used by AIM Global, the symbology identifier prefix is set to ]C2 or ]L4). Also it implies a mode latch to Mixed sub-mode of Text compaction mode.
The escape sequence shall only be placed once at beginning of barcode text, otherwise an OnInvalidChar or OnInvalidDataChar (only for Delphi/C++ Builder 2009 or later) event will occur.
909: The "\909" followed by an application indicator (single Latin alphabetic character from the set "a" to "z" and "A" to "Z", or a two-digit number) represents a leading FNC1 character in "Second position" mode, and indicates that the PDF417 symbol's data output shall conform with the Code128 specification (used by AIM Global, the symbology identifier prefix is set to ]C2 or ]L4). Also it implies a mode latch to Numeric compaction mode.
The escape sequence shall only be placed once at beginning of barcode text, otherwise an OnInvalidChar or OnInvalidDataChar (only for Delphi/C++ Builder 2009 or later) event will occur.
910: It indicates that the PDF417 symbol's data output shall conform with the Code128 specification (standard data package, the symbology identifier prefix is set to ]C0 or ]L5), and implies a mode latch to Mixed sub-mode of Text compaction mode.
The escape sequence shall only be placed once at beginning of barcode text, otherwise an OnInvalidChar or OnInvalidDataChar (only for Delphi/C++ Builder 2009 or later) event will occur.
911: It indicates that the PDF417 symbol's data output shall conform with the Code128 specification (standard data package, the symbology identifier prefix is set to ]C0 or ]L5), and implies a mode latch to Numeric compaction mode.
The escape sequence shall only be placed once at beginning of barcode text, otherwise an OnInvalidChar or OnInvalidDataChar (only for Delphi/C++ Builder 2009 or later) event will occur.
912[AAYYMMDDBB]: It represents a leading FNC1 character in "First position" mode and implies a mode latch to Numeric compaction mode. Not only does it indicate that the PDF417 symbol's data output shall conform with the Code128 specification (UCC/EAN-128 emulation, the symbology identifier prefix is set to ]C1 or ]L3), but also it encodes that the data begins with a 6-digit date field (Application Identifier is 11, 13, 15, or 17), and this date field may be followed by an implied Application Identifier 10 or 21 as well:
For example:
\912[1199010721]
Also, You can encode the 6-digit date field and the subsequent Application Identifier by yourself:
\912994071
You can explicitly insert a mode latch to Numeric compaction mode after the "\912" by using the "-":
\912[-1199010721]
\912[-]994071
The escape sequence shall only be placed once at beginning of barcode text, otherwise the OnInvalidChar or OnInvalidDataChar (only for Delphi/C++ Builder 2009 or later) event will occur.
914: It represents a leading FNC1 character in "First position" mode and implies a mode latch to Numeric compaction mode. It not only indicates that the PDF417 symbol's data output shall conform with the Code128 specification (UCC/EAN-128 emulation, the symbology identifier prefix is set to ]C1 or ]L3), but also indicates that the data begins with an implied Application Identifier is 10.
The escape sequence shall only be placed once at beginning of barcode text, otherwise an OnInvalidChar or OnInvalidDataChar (only for Delphi/C++ Builder 2009 or later) event will occur.
915: It represents a leading FNC1 character in "First position" mode and implies a mode latch to Numeric compaction mode. it not only indicates that the PDF417 symbol's data output shall conform with the Code128 specification (UCC/EAN-128 emulation, the symbology identifier prefix is set to ]C1 or ]L3), but also indicates that the data begins with an implied Application Identifier is 21.
The escape sequence shall only be placed once at beginning of barcode text, otherwise an OnInvalidChar or OnInvalidDataChar (only for Delphi/C++ Builder 2009 or later) event will occur.
916: Insert a 05 macro to barcode text. It shall only be placed once at beginning of the barcode text and it shall not be used in Macro PDF417 symbols. It's completely equivalent to escape sequence "\5".
917: Insert a 06 macro to barcode text. It shall only be placed once at beginning of the barcode text and it shall not be used in Macro PDF417 symbols. It's completely equivalent to escape sequence "\6".
918: It shall be used as a linkage flag to signal the presence of an associated linear component in a composite symbol (other than an ECC.UCC composite symbol). The "\918" may be placed anywhere in the barcode text.
919: Reserved.
920: It shall be used as a linkage flag to signal the presence of an associated linear component in an ECC.UCC composite symbol. The "\920" may be placed anywhere in the barcode text.
921: Instructs the reader to interpret the data contained within the PDF417 symbol as programming for reader initialisation. It only shall be placed once at beginning of the barcode text. In the case of a Macro PDF417 initialisation sequence, it shall appear in every symbol. It's completely equivalent to escape sequence "\r".
924: Manually places a mode latch to Byte compaction mode. It shall be used when the total number of subsequent bytes to be encoded is an integer multiple of 6, otherwise, it will be changed to "\901" automatically by the component.
For some reader, the meanings of some function codewords don't conform with the PDF417 specification. You can use the Options property to change the meanings of these fucntion codewords, in order to match the reader.
Note, the "{RS}" is ASCII character RS (ASCII value 30), the "{GS}" is ASCII character GS (ASCII value 29), and the "{EOT}" is ASCII character EOT (ASCII value 4).
The Extended Channel Interpretation (ECI) protocol allows the output data stream to have interpretations different from that of the default character set. Five broad types of interpretations are supported in PDF417:
The ECI is identified by an integer (up to 6 digits) which is encoded in the PDF417 by the ECI indicator block. The escape sequence "\e[<ECI_Number>]" is used to place the ECI indicator block to the barcode text:
ECI indicator blocks may be placed anywhere in the barcode text in a single or Macro PDF417 set of symbols. For example:
ABC\e[123]DEFabc\e[000003]def
Normally, the sub-mode invoked immediately prior to the ECI escape sequence is preserved for the encodation immediately after it. Thus, sub-mode latches and shifts are preserved across an ECI escape sequence; and thus a sub-mode shift immediately before an ECI escape sequence is not ignored. If the value "poIgnoreShiftBeforeECI" is included in the Options property, the sub-mode shift immediately before an ECI escape sequence is ignored, but a sub-mode latch immediately before an ECI escape sequence is never ignored.
The AllowEscape property should be set to true in order to place the ECI indicator blocks. Any ECI invoked shall apply until the end of the barcode text, or until another ECI indicator block is encountered. Thus the interpretation of the ECI may straddle two or more symbols.
In an environment where space considerations are a primary concern and symbol damage is unlikely (e.g. an office), the right row indicators may be omitted and the stop pattern may be reduced to one module width bar. This reduction version is called Compact PDF417, which is fully decoder compatible with standard PDF417.
Note, the Compact PDF417 was referred as Truncated PDF417 in previous standard.
You can set the Compact property to true in order to generate a Compact PDF417 symbol.
Macro PDF417 provides a mechanism for the data in a file too large to be split into blocks and be represented in more than one PDF417 symbol. This mechanism is similar to the structured append feature in other symbologies. Up to 99999 individual PDF417 symbols may be used to encode data in Macro PDF417.
Each Macro PDF417 symbol shall contain additional control information to enable the original data file to be properly reconstructed, irrespective of the sequence in which the individual PDF417 symbols are scanned and decoded. The escape sequence "\s[<Index>, <File_ID>, <File_Name>, <Amount>, <Time_Stamp>, <Sender>, <Address>, <File_Size>, <Checksum>]" is used to place the control information to the barcode text:
Index: The position index of the symbol within the set of Marco PDF417 symbols. It's an integer between 1 and 999999 (including the boundaries) in decimal string format. Note, the field is required.
File_ID: The file ID. It is a variable length numeric sequence which contains one or more triads of digits. Each triad of digits is an integer between 000 to 899 (the leading zero is required), in decimal string format. For each related Macro PDF417 symbol, the file ID should be specified using the same numeric sequence. This ensures that all reassembled symbol data belongs to the same distributed file representation. Note, the field is required.
File_Name: The file name. It's a text string with an implied reset to ECI 000002. The ECI escape sequences may be used in order to set a different ECI within the field. Note, the field is optional.
Amount: The segment count (identifying the total number of Macro PDF417 symbols in the distributed file). It's an integer between 2 and 99999 (including the boundaries) in decimal string format. Note, the field is optional, if it's used, that field shall appear in every segment.
Time_Stamp: The time stamp. It indicates the time stamp on the source file. It's a GMT time in "yyyy-mm-dd hh:nn:ss" format:
Note, entire time portion or the minute and second portion are optional, i.e. the "yyyy-mm-dd", "yyyy-mm-dd hh", and "yyyy-mm-dd hh:nn" formats are valid. If the hour, minute or second portion is not included, they defaults to 00.
Sender: The sender, It's a text string with an implied reset to ECI 000002. The ECI escape sequences may be used in order to set a different ECI within the field. Note, the field is optional.
Address: The address, It's a text string with an implied reset to ECI 000002. The ECI escape sequences may be used in order to set a different ECI within the field. Note, the field is optional.
File_Size: The file size. It's an integer in decimal string format, and indicates the size in bytes of the entire source file. Note, the field is optional.
Checksum: The checksum, It's an integer value of the 16-bit (2 bytes) CRC checksum using the CCITT-16 polynomial computed over the entire source file, in decimal string format. You can use the GetCheckSum method to calculate the checksum for a source file. Note, the field is optional.
The ECI escape sequences, "\900", "\901", "\902", and "\924" can be used in the File_Name, Sender and Address fields. If you want place the comma in these fields, please use the "\," instead.
An empty string indicates an unused optional field, the subsequent comma can be omitted if all fields of succeeding are unused. otherwise, the comma is required. All unused fields at the end can be omitted.
The control information may only be placed once in the barcode text. Also, it shall be placed at end of the barcode text. The OnInvalidChar or OnInvalidDataChar (only for Delphi/C++ Builder 2009 or later) event will occur if the control information be placed more than once or it isn't placed at end of the barcode text.
The following is an example of Marco PDF417 symbol:
ABCDEFGHIJKLMN\s[2,001287023,,5,2008-12-03 05:30:00,,USA]
Note, if the segment count is unused, a Marco PDF417 terminator, "\t" escape sequence is required in last symbol within the set of Marco PDF417 symbols. Otherwise, it's optional. The "\t" escape sequence shall be placed at the end of the barcode text, after the control information. For example:
ABCDEFGHIJKLMN\s[5,001287023]\t
The AllowEscape property should be set to true in order to place the control information and the terminator.
(*): The Data property, OnInvalidDataLength and OnInvalidDataChar events are available only for the Delphi/C++ Builder 2009 or later.