Supplement
Common one-dimensional barcodes, such as EAN in Europe and UPC in the US, can be extended with an additional code placed to the right of the main code.
UPC-A, UPC-E, EAN-13, and EAN-8 can include an additional barcode to the right of the main barcode. This second barcode, which is usually not as tall as the main barcode, is used to encode additional information for newspapers, books, and other periodicals. The supplemental barcode can encode 2 or 5 digits of information.
The two-digit supplemental code is typically used to encode issue number information in periodicals (magazines, newspapers).
The supplemental code allows to omit issue number from the main barcode, keeping it the same for all issues. Thus, there is no need to scan the large code when only issue information is needed.
Five-digit supplemental code is often used on books and contains information about the suggested retail price of the item. Of the five characters, the first one denotes the currency code, and the remaining 4 – the price.
There are specific codes to indicate no-price conditions:
- code 90000 – retail price for the book is undetermined;
- code 99991 – the book is distributed free of charge.
However, the supplemental code can also store other information for internal use within the publishing house.
Each digit is encoded with 7 modules (bars and spaces).
Code structure:
- start character (1011 if we draw an analogy between bars and digits);
- first data character;
- separator (01);
- second data character or 4 characters in case of a 5-character code.
There is no explicit check character and stop character. After the separator, an admissible number of characters is read.
Data is encoded according to the "left even" and "left odd" sets used in EAN. Depending on the size of the supplemental barcode, different character parity patterns are used. The parity of the character determines the checksum.
If the supplemental barcode is two-digit, then the two-digit number which is formed by adding the first and second numbers must be divided by 4. Next, if the remainder from the division is an even number, then the first character is encoded with even parity, and the second with odd parity. This means that the even set of values will be used for encoding the first digit, and for the second – the odd set.
Now, when scanning, the parity of the read value will be determined. If it does not match the calculated parity, which is expected – it means that the barcode has been read incorrectly.
In the case of a five-digit code, the checksum calculation is more complicated. It is assumed that the last digit of the code is in an odd position. Starting from the last digit and up to the first in turn, even and odd positions are assigned. Then, the sum of all odd digits is taken and multiplied by 3. The sum of all even digits is multiplied by 9. Then, the unit of measurement is taken from the sum of the two previous calculations, that is, the far-right digit. This check digit is used to determine the parity pattern in a special table.
To generate a Supplement 2 (for a two-digit code) or Supplement 5 (for a five-digit code) barcode in FastReport .NET, select the Barcode object at the Components Panel in the Report Designer. In the drop-down list, navigate to the "Others" category, and then choose Supplement 2 or Supplement 5:
After selecting the barcode, place it on the Report Page. Position the supplemental code next to the main code:
Double-click on the added barcode to open the editor. You can also open the barcode editor by clicking the button in the context menu of the added object, accessed by right-clicking:
Like all barcodes in FastReport .NET Supplement, it has several properties that you can edit in the object property inspector:
Property | Description |
---|---|
Angle | Allows you to set the rotation of the object to one of the fixed angles – 0, 90, 180, or 270 degrees. |
Zoom | Sets the scaling of the barcode. This property is used only with the AutoSize property. |
AutoSize | If this property is enabled, the object will be stretched to show the entire barcode. If the property is disabled, the barcode will be stretched to the size of the object. |
ShowText | Determines whether to show the text at the bottom of the barcode. |
DataColumn | The data field from which to load the text of the object. |
Expression | An expression that returns the text of the object. |
Text | The text of the object. |
Padding | Allows you to set the padding from the edges of the object in pixels. |
WideBarRatio | This property is available for all linear barcodes. It defines the relative size of the barcode's wide bars. |
CalcCheckSum | This property is available for many linear barcodes. It determines whether to calculate the checksum automatically. If this property is disabled, the checksum must be present in the object text. |
DrawVerticalBearerBars | If this property is enabled, the side lines will be displayed for the object. |