Securing obtaining barcodes
The purpose of a barcode
The purpose of a barcode is to allow the transfer of printed information to a computer by minimizing:
- the risk of error, essentially
- the acquisition time, incidentally
For this, a bar code reader will only transfer the information it decodes when it is sure to read it correctly. If he hesitates, he will not react: there will certainly be no reading error, but the desired result will not be obtained since there will be no reading!
Securing obtaining barcodes
This security must focus on two points:
- obtaining easily readable barcodes
- obtaining durable barcodes, knowing that the ravages of time (yellowing or deformation of the support, toner detachment, etc.) will have all the less consequences as the barcode will have been obtained without defect at the origin
Five steps will allow you to secure the barcodes obtained by TransBar:
- choose the best encoding; some codes, of old design, are still widely used despite being less secure than those of modern design
- design the barcode in TransBar with minimal risk
- size the barcode to respect a comfortable height/width ratio while avoiding micro-printing defects
- lay out what TransBar provides you with, respecting a few additional rules
- flash, burn or print with some precautions
- test a prototype before reproducing it in large quantities
Choosing the best coding
When the coding is not imposed by a client or by a domain of use, the choice is really limited to two possibilities:
- Code 39
The simplest solution, recommended for short messages consisting only of capital letters, numbers or the few available signs - Code 128
More complex solution, reserved for short messages containing upper or lower case letters, numbers or "ascii" signs. It is theoretically possible to encode western accented letters, but this possibility is rarely understood by reading devices and is not supported by TransBar 5
When these two possibilities prove to be insufficient, the solution is to opt for a matrix code, Datamatrix or other, knowing that this solution requires a specific reader and that its reading is less easy than that of the above codings.
Design a barcode that minimizes risk
When necessary, TransBar checks the information to be coded according to the chosen coding and reports any error with a detailed message:
- character type control
- character count control
- control of the check character if it is mandatory and present in the information to be coded (if it is not present while mandatory, TransBar will calculate it and add it automatically)
- message syntax control
Five settings remain your responsibility in TransBar: length of information to be encoded, initialization reserves, optional control characters, bar height, and printer resolution.
Length of encoded information
When the length of the information to be coded is not imposed by the coding or by an external specification, it is tempting to increase it beyond what is strictly necessary, by adding secondary information to a reference. For example, adding the customer's name to an invoice number. This is not a good solution. A barcode is all the more difficult to decode, and consequently all the more fragile, if it has a large number of bars: it will always be wiser to code an index to a record of a database than the information making up this record.
Added initialization reserves
Initialization reserves are clear areas located on either side of a barcode. They allow the reader to disregard elements external to the code to be read, for example below a frame surrounding the bar code. Without initialization reservations, a bar is added on either side of the code and the reader will not understand it.
with reservations, correct | without reservations, unreadable |
The minimum width of these reservations is standardized for each of the encodings. In some encodings, these reserves are marked by a sign < or > upstream or downstream of the caption, or by a frame, or by the offset of the first digit of the caption.
Depending on the coding, TransBar makes it possible to remove these initialization reservations, not because they are optional, but because they can be introduced de facto by the layout alone, for example when the barcode is placed in the middle of a a light area, and because the presence of signs in the legend is sometimes not desired.
Adding an optional control character
Some encodings allow the addition of an optional control character which reinforces security in the transfer of information. This option is highly recommended in older encodings, but requires the reader to be set up to control and then remove this control character.
Sizing the barcode
After obtaining a barcode, TransBar provides you with the following instructions:
- the name of the font to use
- the size to use
Following these instructions is essential but is not always sufficient.
The choice of font, in addition to the absence or presence of a caption, will essentially determine the height of the bars. Or rather the slenderness of the barcode, ie the ratio between the height of the barcode and its width. This ratio must be adapted to the type of reading envisaged. For manual presentation, either of the reader in front of the barcode, or of the barcode in front of the reader, the most usual cases, this ratio must not be less than 1/6, under penalty of drastically limiting the obliqueness allowed in the positioning of the reader.
Examples of minimum ratio 1/6:
above, font C39T48L, 13 characters
below, font C39T30L, 7 characters
These two barcodes differ only in the height of the bars,
a higher height allowing for a greater number of characters
with slenderness, therefore with ease of reading, identical!
In the encodings which make it possible to encode information of variable length, this choice will also depend on this length. For presentation on an automatic chain, the minimum ratio will depend on the type of reader (linear or rotating beam), the conveying speed and the positioning accuracy of the object supporting the barcode.
Furthermore, very high bars will increase the vertical redundancy of the coded information, which will enable the barcode to withstand a task, a tear or a masking of large dimensions while remaining readable along a given line.
Once the font has been chosen, the choice of the size in which it will be printed will determine the height of the barcode, but will also affect its width. The size must be chosen according to the printing resolution, so as to obtain printed bars whose widths correspond precisely to an integer number of printer points. For example, if, given the size chosen, thin bars are theoretically described by 5.3333 printer points, i.e. 16 points for 3 bars, in practice they will be described twice by 5 points and another time by 6 points. This type of error is especially noticeable in low resolutions, but, whatever this resolution, it will combine with the inaccuracy and irregularity of the printing point due to mechanical play to degrade the quality of the barcode, therefore his life expectancy.
Barcode sizing in response to the two constraints expressed above:
- general sizing
- precise sizing
is the subject of a dedicated chapter.
Layout
Text layout
Prohibit the use of bold, oblique or italic styles, etc.
In professional layout:
- prohibit any kerning or approach between characters (under Indesign, specify a "metric" kerning, prohibit the "optical" kerning which introduces approaches different from those programmed in the font)
- prohibit any horizontal scale (but a vertical scale is authorized to finely adjust the height of the bars)
Warning: when you paste a barcode into a layout as text, your input takes on the attributes of the original text: you can introduce unwanted settings without realizing it!
Coloring
It is best to print barcodes in black on a white background. As texts are generally printed in pure black, rather than a Cyan-Magenta-Yellow combination, the use of a barcode font therefore meets this requirement perfectly.
Coloring the bars or the background is still possible, but it will always reduce the readability and durability of the barcode due to:
- the reduced contrast, which makes it all the more difficult to judge that the readers are using a red light and not a white light
- the imprecision brought by the dithering in the limits between colors, therefore between light and dark bars, imprecision that can only be avoided by using spot colors
At a minimum, observe the following rules and then experiment with different readers of different technologies because some readers accept to read light bars on a dark background, others do not:
- background color will always be less of a problem than bar color
- the background color should be uniform. Defined in RGB, it should consist of as much red as possible, and as little green and blue as possible. In CMYK, it will not include black or cyan; it will therefore be white, yellow, magenta, orange or pink
- the color of the bars, if not black, must also be uniform. Defined in RGB, it must consist of a minimum of red, green and blue. In CMYK, it will consist of as much black and cyan as possible and as little magenta and yellow as possible; it will therefore be black, dark grey, dark burgundy, dark green or dark blue
A transparent background is not admissible, but transparent bars on a white background are on the other hand possible, provided that the transparency is real (for example a clear glass bottle containing water) and not fictitious (for example a green glass bottle or milk container).
Flash, burn or print
The printer must be chosen according to the resolution which governed the development of the bar code. A barcode designed for office resolution (300 or 600 dots per inch) can always be flashed or engraved at high resolution (equal to or greater than 1800 dots per inch), but the reverse is not certain.
When printing PDF documents, prohibit any adaptation of dimension to the margins of the printer, as well as any scaling other than 100%.
Print fattening must be controlled (less than 0.02 mm, or 0.04 mm from edge to edge), which is very generally the case in offset or gravure printing excluding newsprint paper. Screen printing or flexography warrants a trial.
Printing on recycled paper is not advisable as it will reduce the contrast between dark bars and light bars, which will affect the readability of the barcode.
Printing a barcode on transparent film is possible, but its reading will require that this film be placed on a white surface, and preferably by placing the ink in contact with the white surface.
Test a prototype
Finally, regardless of the precautions taken in the previous steps, it seems unreasonable to print a large number of documents without prior verification of the readability of the barcodes obtained.
Elementary testing of a prototype can be performed using a low-performance reader, such as a contact reader, assuming that a barcode that will be easily read by this pen will also be easily read by readers performance that most users have.
Please note: a barcode that is not read by a reader is not necessarily of poor quality:
- the reader, if it is connected to a database, can only read the barcodes known to this database (general case of retail)
- the player can be set to recognize only certain codings
- the reader can be configured to only recognize messages of a given length (common case in Code 2/5)