The component is used to create the Code 16K 2D Barcode symbols. It's defined in the pfmxCode16K unit.
Code 16K was developed by Ted Williams in 1989 to provide a simple to print and decode multiple row symbology. It's a continuous, variable-length, stacked 2D barcode symbology that can encode the complete ASCII 128-character set. Extended ASCII characters (ASCII value 128 to 255) may also be encoded by using function character.
Each Code 16K symbol contains from 2 to 16 rows. Each row is divided by a separator bar. The top and bottom of the symbol also have separator bars that extend to the ends of the minimum quiet zones.
Each Code 16K symbol contains from 2 to 16 stacked rows, with 5 ASCII characters per stacked row. The RowHeight property can be used to specify the height for each stacked row, in modules. The data capacities are listed in following table:
Rows | Maximum data capacities | |
---|---|---|
Numeric characters | ASCII characters | |
2 | 14 | 7 |
3 | 24 | 12 |
4 | 34 | 17 |
5 | 44 | 22 |
6 | 54 | 27 |
7 | 64 | 32 |
8 | 74 | 37 |
9 | 84 | 42 |
10 | 94 | 47 |
11 | 104 | 52 |
12 | 114 | 57 |
13 | 124 | 62 |
14 | 134 | 67 |
15 | 144 | 72 |
16 | 154 | 77 |
You can use the MinRows and the MaxRows properties to specify the minimum and maximum number of stacked rows for a Code 16K symbol. They can be one of values from 2 to 16 (defined in the pfmxCode16K unit). The smallest number of symbol stacked rows that accommodates the barcode text will be automatically selected between minimum and maximum number of stacked rows.
If the barcode text does not fill the maximum data capacity of the Code 16K symbol, remaining data capacity of the symbol will be filled by adding the PAD characters automatically. If the barcode text is so long that it cannot be encoded using the maximum number of stacked rows specified by the MaxRows property, an OnInvalidLength or OnInvalidDataLength event will occur. You can use the CurrentRows property to get the factual number of stacked rows.
The Code 16K symbol width is 81 modules (inclusive of minimum leading quiet zone and trailing quiet zone). The minimum row height value is 8 times the module width. So the smallest Code 16K symbol is 81 * 19 modules square and the largest is 81 * 145 modules square (inclusive of minimum quiet zones, the row height is set to 8 modules, and the separator bar height is set to 1 module).
The minimum value of the module width is 7.5 mils (0.19 mm). So the minimum physical size is 15.4mm * 3.6mm. The maximum data density is 208 alphanumeric characters per square inch or 417 numeric digits per square inch when the symbol is printed at 7.5 mils.
The leading quiet zone shall be a minimum of 10 modules, the trailing quiet zone shall be a minimum of 1 modules. No top quiet zone and bottom quiet zone are required outside the bounds of the symbol.
So the minimum value of LeadingQuietZone property is equal to 10, the minimum value of TrailingQuietZone property is equal to 1, and the minimum value of TopQuietZone, and BottomQuietZone properties are equal to 0.
All 128 ASCII characters, i.e. ASCII characters 0 to 127 inclusive, in accordance with ISO/IEC 646:1991.
Code 16K has three unique data character sets as code sets A, B and C, all 128 ASCII characters are encoded by internally switching between all 3 code sets:
The code set will be switched automatically in a Code 16K symbol in order to minimize the symbol size. Also, you can manually switch the code set by using following escape sequences:
The AllowEscape property should be set to true in order to place these escape sequences. If the symbol mode specified by the InitialMode property is set to emCodeC_Shift1B, they cannot be used as the first character in the symbol. If the InitialMode property is set to emCodeC_Shift2B, they cannot be used as the first two characters in the symbol. In addition they can be placed anywhere within the symbol.
Characters with ASCII values 128 to 255 in accordance with ISO 8859-1:1998 may also be encoded. This is done by internally using the FNC4 character together with code sets A, B and C.
4 function characters, and PAD character:
The AllowEscape property should be set to true in order to place the functions characters, or the PAD character.
Code 16K has initial modes which are used to specify the initial code set and may also represent an implied leading FNC1 character or implied leading SHIFT B character as shown in following table. The code set will be automatically switched if a character is encountered that cannot be encoded by current code set. And implied characters function as if they were actual symbol characters but don not occupy any space.
There are seven kinds of initial mode, from 0 to 6, and a kind of extended data length mode. The initial mode values from emCodeA to emExtended, corresponding to these modes, are defined in the pfmxCode16K unit. These modes and their values are listed in following table:
Initial Mode | Value | Initial code set | Implied character | Description |
---|---|---|---|---|
0 | emCodeA | A | (None) | The code set will be automatically switched if another code set character is encountered. |
1 | emCodeB | B | (None) | |
2 | emCodeC | C | (None) | |
3 | emCodeB_FNC1 | B | FNC1 | |
4 | emCodeC_FNC1 | C | FNC1 | |
5 | emCodeC_Shift1B | C | SHIFT B | First character excepting the message append block (if exists), must be code set B character (ASCII 32 - ASCII 127), otherwise an OnInvalidChar or OnInvalidDataChar event will occur. The code set will be automatically switched if another code set character is encountered. |
6 | emCodeC_Shift2B | C | Double SHIFT B | First two characters excepting the message append block (if exists), must be code set B characters (ASCII 32 - ASCII 127), otherwise an OnInvalidChar or OnInvalidDataChar event will occur. The code set will be automatically switched if another code set character is encountered. |
Extended data length mode | emMode_Extended | B | None | Indicates to create a Code 16K barcode symbol in extended data length mode. An extended data length mode block is required, and it should be placed at beginning of barcode text, otherwiset the OnInvalidChar or OnInvalidDataChar event will occur. See also the "Extended data length mode" section below. |
The InitialMode property can be used to specify the initial mode for a Code 16K symbol. It can be one of values shown in table above, corresponding to the initial modes 0 to 6, and the extended data length mode. Also, it can be set to emAuto (defined in the pfmxCode16K unit), in this case, one of values from emCodeA to emModeC_Shift2B, corresponding to the initial modes 0 to 6 shown in table above will be selected automatically, depending on the barcode text, in order to minimize the symbol size.
You can always use the CurrentMode property to get the factual initial mode.
If the AllowEscape property is set to true, following escape sequences are supported by the component, you can insert them to the barcode text:
The extended data length mode is used to encode data beyond the capacity of a single Code 16K symbol. In the extended data length mode, up to 107 Code 16K 16-rows symbols may be arranged to convey more data (up to 8025 ASCII characters, or 16050 numeric digits). If a symbol is part of these extended data length mode symbols, this shall be indicated by extended data length mode block in barcode text. The escape sequence "\m[<Index>, <Amount>]" is used to place the extended data length mode block to the barcode text:
The AllowEscape property should be set to true in order to place the extended data length mode block. The extended data length mode block may be placed only once in the barcode text. Also, it shall be placed at beginning of the barcode text. The OnInvalidChar or OnInvalidDataChar event will occur if the extended data length mode block be placed more than once, or it isn't placed at beginning of the barcode text. The following is an example of extended data length mode symbol:
\m[2,12]ABCDEFG1234567
The InitialMode property should be set to emAuto or emMode_Extended if an extended data length mode block is placed in the barcode text, otherwise the OnInvalidChar or OnInvalidDataChar event will occur. Conversely, the extended data length mode block is required if the InitialMode property is set to emMode_Extended, otherwise the OnInvalidChar or OnInvalidDataChar event will occur too.
The extended data length mode block shouldn't be placed together with message append block in the barcode text, otherwise the OnInvalidChar or OnInvalidDataChar event will occur. See also the "Message append (structured append)" section below.
If a symbol is encoded in extended data length mode, the number of stacked rows will be changed to 16 automatically.
Note, if only two symbols are to be logically linked in extended data length mode, they may be arranged horizontally or vertically adjacent to each other. If more symbols are to be logically linked, they shall be arranged in a single vertical stack. The maximum number of symbols should be specified for the application.
The message append is a method similar to the extended data length mode to encode data beyond the capacity of a single Code 16K symbol. Up to 9 Code 16K symbols may be appended in a structured format to convey more data. It should only be used in closed systems. If a symbol is part of a message append this shall be indicated by a message append block in barcode text. The escape sequence "\s[<Index>, <Amount>]" is used to place the message append block to the barcode text:
The AllowEscape property should be set to true in order to place the message append block. The message append block may be placed only once in the barcode text. Also, it shall be placed at beginning of the barcode text. The OnInvalidChar or OnInvalidDataChar event will occur if the message append block be placed more than once or it isn't placed at beginning of the barcode text. The following is an example of message append symbol:
\s[2,5]ABCDEFGHIJKLMN012345
The message block shouldn't be placed together with extended data length mode block in the barcode text, otherwise the OnInvalidChar or OnInvalidDataChar event will occur. See also the "Extended data length mode" section above.
The message append block shouldn't be placed in the barcode text if the InitialMode property is set to emMode_Extended, otherwise the OnInvalidChar or OnInvalidDataChar event will occur.
The symbols in a message append should not be arranged horizontally, but only in a single vertical stack.