The EANJK font can be used to print UPC and EAN bar codes – used for product marking. A specification of these, numbers only, bar codes can be found at Agilent Technologies.
One can not get a correct bar code for a given message by printing it directly using the EANJK font. You can use the enclosed Perl script ean.pl, or the Visual Basic script EAN.VBS, to convert a string into the correct form to be used with the EANJK font. If you are not using these scripts, the string to be printed should be generated as follows:
Using the specification, identify parities etc for each digit in the code (note that the first digit in the EAN code is encoded in the parity of the others). Encode the message using the following table:
Character | Used in |
---|---|
Digits 0 to 9 | UPC A left hand EAN left hand A Supplemental odd parity |
Letters a to j | UPC E even parity EAN left hand B Supplemental even parity |
Letters A to J | UPC A right hand UPC E odd parity EAN right hand |
| | Left and right hand guard bars |
- | Center guard pattern |
} | UPC E right hand guard bars |
[ | Supplemental left hand guard bars |
: | Supplemental character delineator |
Space | Separates UPC/EAN code and supplemental |
Example: the EAN 13 code 9780201101744 with supplemental
52295 should be printed as the string
"|7ia2a1-BABHEE| [5:2:c:j:5
" using the EANJK
font.