Zint: Manual
6. Types of symbology
6.1 One-Dimensional symbols
One-Dimensional Symbols are what most people associate with the term barcode. They consist of a number of bars and a number of spaces of differing widths.
6.1.1 Code 11
Developed by Intermec in 1977, Code 11 is similar to Code 2 of 5 Matrix and is primarily used in telecommunications. The symbol can encode any length string consisting of the digits 0-9 and the dash character (-). Two modulo-11 check digits are added by default. To add just one check digit, set option_2 = 1 or --vers=1. To add no check digits, set option_2 = 2 or --vers=2.
6.1.2 Code 2 of 5
Code 2 of 5 is a family of one-dimensional symbols, 8 of which are supported by Zint. Note that the names given to these standards alters from one source to another so you should take care to ensure that you have the right barcode type before using these standards.
6.1.2.1 Standard Code 2 of 5
Also known as Code 2 of 5 Matrix this is a self-checking code used in industrial applications and photo development. Standard Code 2 of 5 will encode any length numeric input (digits 0-9). No check digit is added by default. To add a check digit, set option_2 = 1 or --vers=1. To add a check digit but not show it in the Human Readable Text, set option_2 = 2 or --vers=2.
6.1.2.2 IATA Code 2 of 5
Used for baggage handling in the air-transport industry by the International Air Transport Agency, this self-checking code will encode any length numeric input (digits 0-9). No check digit is added by default. To add a check digit, set option_2 = 1 or --vers=1. To add a check digit but not show it in the human readable text, set option_2 = 2 or --vers=2.
6.1.2.3 Industrial Code 2 of 5
Industrial Code 2 of 5 can encode any length numeric input (digits 0-9). No check digit is added by default. To add a check digit, set option_2 = 1 or --vers=1. To add a check digit but not show it in the Human Readable Text, set option_2 = 2 or --vers=2.
6.1.2.4 Interleaved Code 2 of 5
This self-checking symbology encodes pairs of numbers, and so can only encode an even number of digits (0-9). If an odd number of digits is entered a leading zero is added by Zint. No check digit is added by default. To add a check digit, set option_2 = 1 or --vers=1. To add a check digit but not show it in the human readable text, set option_2 = 2 or --vers=2.
6.1.2.5 Code 2 of 5 Data Logic
Data Logic does not include a check digit by default and can encode any length numeric input (digits 0-9). To add a check digit, set option_2 = 1 or --vers=1. To add a check digit but not show it in the Human Readable Text, set option_2 = 2 or --vers=2.
6.1.2.6 ITF-14
ITF-14, also known as UPC Shipping Container Symbol or Case Code is based on Interleaved Code 2 of 5 and requires a 13 digit numeric input (digits 0-9). One modulo-10 check digit is added by Zint.
If no border option is specified Zint defaults to adding a bounding box with a border width of 5. This behaviour can be overridden by using the --bind option (or adding BARCODE_BIND to symbol->output_options). Similarly the border width can be overridden using --border= (or by setting symbol->border_width). If a symbol with no border is explicitly required this can be achieved by setting the border type to box or bind and setting the border width to 0.
6.1.2.7 Deutsche Post Leitcode
Leitcode is based on Interleaved Code 2 of 5 and is used by Deutsche Post for mailing purposes. Leitcode requires a 13-digit numerical input and includes a check digit.
6.1.2.8 Deutsche Post Identcode
Identcode is based on Interleaved Code 2 of 5 and is used by Deutsche Post for mailing purposes. Identcode requires an 11-digit numerical input and includes a check digit.
6.1.3 Universal Product Code (EN 797)
6.1.3.1 UPC Version A
UPC-A is used in the United States for retail applications. The symbol requires an 11 digit article number. The check digit is calculated by Zint. In addition EAN-2 and EAN-5 add-on symbols can be added using the + character. For example, to draw a UPC-A symbol with the data 72527270270 with an EAN-5 add-on showing the data 12345 use the command:
zint --barcode=34 -d 72527270270+12345
or encode a data string with the + character included:
my_symbol->symbology = BARCODE_UPCA;
error = ZBarcode_Encode_and_Print(my_symbol,"72527270270+12345");
If your input data already includes the check digit symbology BARCODE_UPCA_CHK (35) can be used which takes a 12 digit input and validates the check digit before encoding.
You can adjust the gap between the main symbol and an add-on in multiples of the X-dimension by setting --addongap= (option_2) to a value between 9 (default) and 12.
6.1.3.2 UPC Version E
UPC-E is a zero-compressed version of UPC-A developed for smaller packages. The code requires a 6 digit article number (digits 0-9). The check digit is calculated by Zint. EAN-2 and EAN-5 add-on symbols can be added using the + character as with UPC-A. In addition Zint also supports Number System 1 encoding by entering a 7-digit article number stating with the digit 1. For example:
zint --barcode=37 -d 1123456
or
my_symbol->symbology = BARCODE_UPCE;
error = ZBarcode_Encode_and_Print(my_symbol, "1123456");
If your input data already includes the check digit symbology BARCODE_UPCE_CHK (38) can be used which takes a 7 or 8 digit input and validates the check digit before encoding.
You can adjust the gap between the main symbol and an add-on in multiples of the X-dimension by setting --addongap= (option_2) to a value between 7 (default) and 12.
6.1.4 European Article Number (EN 797)
6.1.4.1 EAN-2, EAN-5, EAN-8 and EAN-13
The EAN system is used in retail across Europe and includes standards for EAN-2 and EAN-5 add-on codes, EAN-8 and EAN-13 which encode 2, 5, 7 or 12 digit numbers respectively. Zint will decide which symbology to use depending on the length of the input data. In addition EAN-2 and EAN-5 add-on symbols can be added using the + symbol as with UPC symbols. For example:
zint --barcode=13 -d 54321
will encode a stand-alone EAN-5, whereas
zint --barcode=13 -d 7432365+54321
will encode an EAN-8 symbol with an EAN-5 add-on. As before these results can be achieved using the API:
my_symbol->symbology = BARCODE_EANX;
error = ZBarcode_Encode_and_Print(my_symbol, "54321");
error = ZBarcode_Encode_and_Print(my_symbol,"7432365+54321");
All of the EAN symbols include check digits which is added by Zint.
If you are encoding an EAN-8 or EAN-13 symbol and your data already includes the check digit then you can use symbology BARCODE_EANX_CHK (14) which takes an 8 or 13 digit input and validates the check digit before encoding.
You can adjust the gap between the main symbol and an add-on in multiples of the X-dimension by setting --addongap= (option_2) to a value between 7 (default) and 12.
6.1.4.2 SBN, ISBN and ISBN-13
EAN-13 symbols (also known as Bookland EAN-13) can also be produced from 9-digit SBN, 10-digit ISBN or 13-digit ISBN-13 data. The relevant check digit needs to be present in the input data and will be verified before the symbol is generated. In addition EAN-2 and EAN-5 add-on symbols can be added using the + symbol as with UPC symbols, and the gap set with --addongap= (option_2) to between 7 (default) and 12.
6.1.5 Plessey
Also known as Plessey Code, this symbology was developed by the Plessey Company Ltd. in the UK. The symbol can encode any length data consisting of digits (0-9) or letters A-F and includes a CRC check digit.
6.1.6 MSI Plessey
Based on Plessey and developed by MSE Data Corporation, MSI Plessey is available with a range of check digit options available by setting option_2 or by using the --ver= switch. Any length numeric (digits 0-9) input can be encoded. The table below shows the options available:
Value of option_2 | Check Digits |
---|---|
0 | None |
1 | Modulo-10 (Luhn) |
2 | Modulo-10 & Modulo-10 |
3 | Modulo-11 (IBM) |
4 | Modulo-11 (IBM) & Modulo-10 |
5 | Modulo-11 (NCR) |
6 | Modulo-11 (NCR) & Modulo-10 |
6.1.7 Telepen
6.1.7.1 Telepen Alpha
Telepen Alpha was developed by SB Electronic Systems Limited and can encode any length of ASCII text input. Telepen includes a modulo-127 check digit.
6.1.7.2 Telepen Numeric
Telepen Numeric allows compression of numeric data into a Telepen symbol. Data can consist of pairs of numbers or pairs consisting of a numerical digit followed an X character. For example: 466333 and 466X33 are valid codes whereas 46X333 is not (the digit pair "X3" is not valid). Telepen Numeric includes a modulo-127 check digit which is added by Zint.
6.1.8 Code 39
6.1.8.1 Standard Code 39 (ISO 16388)
Standard Code 39 was developed in 1974 by Intermec. Input data can be of any length and can include the characters 0-9, A-Z, dash (-), full stop (.), space, asterisk (*), dollar ($), slash (/), plus (+) and percent (%). The standard does not require a check digit but a modulo-43 check digit can be added if required by setting option_2 = 1 or using --ver=1.
6.1.8.2 Extended Code 39
Also known as Code 39e and Code39+, this symbology expands on Standard Code 39 to provide support to the full ASCII character set. The standard does not require a check digit but a modulo-43 check digit can be added if required by setting option_2 = 1 or using --ver=1.
6.1.8.3 Code 93
A variation of Extended Code 39, Code 93 also supports full ASCII text. Two check digits are added by Zint.
6.1.8.4 Pharmazentralnummer (PZN)
Pharmazentralnummer is a Code 39 based symbology used by the pharmaceutical industry in Germany. Pharmazentralnummer encodes a 6 digit number to which Zint will add a modulo-10 check digit.
6.1.8.5 LOGMARS
LOGMARS (Logistics Applications of Automated Marking and Reading symbols) is a variation of the Code 39 symbology used by the US Department of Defence. LOGMARS encodes the same character set as Standard Code 39 and adds a modulo-43 check digit.
6.1.8.6 Code 32
A variation of Code 39 used by the Italian Ministry of Health ("Ministero della Sanità ") for encoding identifiers on pharmaceutical products. This symbology requires a numeric input up to 8 digits in length. A check digit is added by Zint.
6.1.8.7 HIBC Code 39
This option adds a leading '+' character and a trailing modulo-49 check digit to a standard Code 39 symbol as required by the Health Industry Barcode standards.
6.1.8.8 Vehicle Identification Number (VIN)
A variation of Code 39 that for vehicle identification numbers used in North America (first character '1' to '5') has a check character verification stage. An Import character prefix 'I' can be added by setting option_2 = 1 or using --vers=1.
6.1.9 Codabar (EN 798)
Also known as NW-7, Monarch, ABC Codabar, USD-4, Ames Code and Code 27, this symbology was developed in 1972 by Monarch Marketing Systems for retail purposes. The American Blood Commission adopted Codabar in 1977 as the standard symbology for blood identification. Codabar can encode any length string starting and ending with the letters A-D and containing between these letters the numbers 0-9, dash (-), dollar ($), colon (:), slash (/), full stop (.) or plus (+). No check digit is generated.
6.1.10 Pharmacode
Developed by Laetus, Pharmacode is used for the identification of pharmaceuticals. The symbology is able to encode whole numbers between 3 and 131070.
6.1.11 Code 128
6.1.11.1 Standard Code 128 (ISO 15417)
One of the most ubiquitous one-dimensional barcode symbologies, Code 128 was developed in 1981 by Computer Identics. This symbology supports full ASCII text and uses a three-mode system to compress the data into a smaller symbol. Zint automatically switches between modes and adds a modulo-103 check digit. Code 128 is the default barcode symbology used by Zint. In addition Zint supports the encoding of Latin-1 (non-English) characters in Code 128 symbols [1]. The Latin-1 character set is shown in Appendix A.
6.1.11.2 Code 128 Subset B
It is sometimes advantageous to stop Code 128 from using subset mode C which compresses numerical data. The BARCODE_CODE128B option (symbology 60) suppresses mode C in favour of mode B.
6.1.11.3 GS1-128
A variation of Code 128 also known as UCC/EAN-128, this symbology is defined by the GS1 General Specification. Application Identifiers (AIs) should be entered using [square bracket] notation. These will be converted to (round brackets) for the human readable text. This will allow round brackets to be used in the data strings to be encoded. Fixed length data should be entered at the appropriate length for correct encoding. GS1-128 does not support extended ASCII characters. Check digits for GTIN data (AI 01) are not generated and need to be included in the input data. The following is an example of a valid GS1-128 input:
zint --barcode=16 -d "[01]98898765432106[3202]012345[15]991231"
6.1.11.4 EAN-14
A shorter version of GS1-128 which encodes GTIN data only. A 13 digit number is required. The GTIN check digit and AI (01) are added by Zint.
6.1.11.5 NVE-18
A variation of Code 128 the "Nummer der Versandeinheit" standard includes both modulo-10 and modulo-103 check digits. NVE-18 requires a 17 digit numerical input and check digits are added by Zint.
6.1.11.6 HIBC Code 128
This option adds a leading '+' character and a trailing modulo-49 check digit to a standard Code 128 symbol as required by the Health Industry Barcode standards.
6.1.11.7 DPD Code
Another variation of Code 128 as used by DPD (Deutsher Paket Dienst). Requires a 28 character alphanumeric input. Zint formats Human Readable Text as specified by DPD and adds a modulo-36 check character.
6.1.12 GS1 DataBar (ISO 24724)
Also known as RSS (Reduced Spaced symbology) these symbols are due to replace GS1-128 symbols in accordance with the GS1 General Specification. If a GS1 DataBar symbol is to be printed with a 2D component as specified in ISO 24723 set option_1 = 2 or use the option --mode=2 at the command prompt. See section 6.3 of this manual to find out how to generate DataBar symbols with 2D components.
6.1.12.1 DataBar Omnidirectional and DataBar truncated
Also known as RSS-14 this standard encodes a 13 digit item code. A check digit and application identifier of (01) are added by Zint. To produce a truncated symbol set the symbol height to a value between 32 and 13. Normal DataBar-14 symbols should have a height of 33 or greater.
6.1.12.2 DataBar Limited
Also known as RSS Limited this standard encodes a 13 digit item code and can be used in the same way as DataBar-14 above. DataBar Limited, however, is limited to data starting with digits 0 and 1 (i.e. numbers in the range 0 to 1999999999999). As with DataBar-14 a check digit and application identifier of (01) are added by Zint.
6.1.12.3 DataBar Expanded
Also known as RSS Expanded this is a variable length symbology capable of encoding data from a number of AIs in a single symbol. AIs should be encased in [square brackets] in the input data. This will be converted to (rounded brackets) before it is included in the human readable text attached to the symbol. This method allows the inclusion of rounded brackets in the data to be encoded. GTIN data (AI 01) should also include the check digit data as this is not calculated by Zint when this symbology is encoded. Fixed length data should be entered at the appropriate length for correct encoding. The following is an example of a valid DataBar Expanded input
zint --barcode=31 -d "[01]98898765432106[3202]012345[15]991231"
6.1.13 Korea Post Barcode
The Korean Postal Barcode is used to encode a six-digit number and includes one check digit.
6.1.14 Channel Code
A highly compressed symbol for numeric data. The number of channels in the symbol can be between 3 and 8 and this can be specified by setting the value of option_2. It can also be determined by the length of the input data e.g. a three character input string generates a 4 channel code by default. The maximum values permitted depend on the number of channels used as shown in the table below:
Channels | Minimum Value | Maximum Value |
---|---|---|
3 | 00 | 26 |
4 | 000 | 292 |
5 | 0000 | 3493 |
6 | 00000 | 44072 |
7 | 000000 | 576688 |
8 | 0000000 | 7742862 |
Note that 7 and 8 channel codes require a processor intensive algorithm to generate and so response times when generating these codes will be relatively slow.