Use Checksum and Supplement Data for Barcodes

Skip to end of metadata
Go to start of metadata
What is Checksum?

A Checksum is an error detection scheme in which some additional characters are added to a barcode to protect the integrity of barcode data. Checksums are not necessary for all kinds of barcodes. For example, Code128 and Code39 are self-checking and checksums for such symbologies are not necessary. But on the other hand, another symbology like Interleaved2Of5, which can only represent numeric data, has very little spaces between its bars and is prone to substitution errors. So, for such symbologies, checksums are necessary. There are also some symbologies such as UPC (Universal Product Code) that require a checksum.

What is Supplemental Barcode?

UPCA, UPCE, EAN13 and EAN8 symbologies may all include an additional barcode to the right of the main barcode. This second barcode that is usually not as tall as the main barcode, is called Supplemental Barcode and is used to encode additional information for newspapers, books and other periodicals.

The supplemental barcode may either encode 2 or 5 digits of information as shown in the figure below:

Figure: Difference between 2 and 5 digit supplemental barcodes

The above barcodes are generated using EAN13 symbology.
Supplemental Barcodes

2 Digit Supplemental Barcodes are mostly used with magazines, newspapers and other such periodicals. The 2 Digit Supplement represents the issue number of the magazine that can be used to track which issue of the magazine is being sold, perhaps for sales analysis or restocking purposes.

5 Digit Supplemental Barcodes are used on books to indicate a suggested retail price. The first digit of the supplement indicates the currency in which the price is expressed. A "0" represents a price expressed in British Pounds whereas a "5" represents a price expressed in US Dollars. The remaining 4 digits of the supplement indicate the price.

Aspose.BarCode & Checksum

Using Aspose.BarCode, developers can enable Checksum for the barcode by passing “true” to setEnableChecksum() method of the barcode class. Checksum can also be made visible or hidden in the barcode image by passing true of false to setEnableChecksum() method.

[Java]
//Instantiate barcode object
BarCodeBuilder bb = new BarCodeBuilder();

//Set the Code text for the barcode
bb.setCodeText("1234567");

//Set the symbology type to Code39
bb.setSymbologyType(Symbology.Code39Standard);

//Make the checksum to be visible on the barcode
bb.setEnableChecksum(true);

//Save the image to your system
//and set its image format to Jpeg
bb.save("barcode.jpg", "jpg");
 

The output barcode image generated by the above code is shown below, where in Code text: "1234567", a character "S" appended at the end, is the Checksum.

Figure: Resulting barcode image generated after example code execution

Checksum Applicable Symbologies

Once the EnableChecksum property is set to true, the Checksum is shown on the barcode image. Applicable symbology:

  • Code11
  • Code39Extended
  • Code39Standard
  • Code93Extended
  • Code93Standard
  • Interleaved2of5
  • Standard2of5

The following Symbology always include checksum:

  • EAN13
  • EAN8
  • BooklandEAN
Aspose.BarCode & Supplement Data

It is possible to encode 2 or 5 Digit Supplement Data in the barcode using setSupplementData() method of BarCodeBuilder class in Aspose.BarCode. Moreover, the space between the main barcode and supplemental barcode can also be customized by using the setSupplementSpace() method of BarCodeBuilder class.

[Java]
//Instantiate barcode object
BarCodeBuilder bb = new BarCodeBuilder();

//Set the Code text for the barcode
bb.setCodeText("123456789123");

//Set the symbology type to EAN13
bb.setSymbologyType(Symbology.EAN13);

//Set the supplement data (5 Digit)
bb.setSupplementData("12345");

//Set space between the supplemental barcode and main barcode
bb.setSupplementSpace(2.0f);

//Save the image to your system
//and set its image format to Jpeg
bb.save("barcode.jpg", "jpg");
 

The output barcode generated by the above code is shown in the figure below:

Figure: Resulting barcode image generated after example code execution

Symbologies that support Supplemental Barcodes

The barcode symbologies, which support supplemental barcodes are as follows:

  • UPCA
  • UPCE
  • EAN13
  • EAN8
  • BooklandEAN
  • Interleaved2of5
  • Standard2of5

SupplementSpace is the space between main barcode and the supplement data, this setting generally will not affect the scan result. The following sample shows diffenent SupplementSpace settings:

Figure: SupplementSpace = 2



Figure: SupplementSpace = 4



Figure: SupplementSpace = 6

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.