RSS / GS1 Databar and EAN-UCC Composite Barcodes for Delphi


Introduction

This component can be used in delphi applications for creating RSS / GS1 Databar and EAN-UCC composite barcodes. The supported symbologies are:

  • RSS. The EAN.UCC Reduced Space Symbology (RSS) family contains three linear symbologies:
    • RSS-14 encodes a 14-digit EAN.UCC item identification. This symbology has 4 formats , regular, truncated, stacked and omni-directional stacked.
    • RSS Limited encodes a 14-digit EAN.UCC item identification with Indicator digits of zero or one in a linear symbol for use on small items.
    • RSS Expanded encodes EAN.UCC item identification plus supplementary AI element strings such as weight and “best before” date in a linear symbol. This symbology has 2 formats, regular and stacked.
  • EAN-UCC Composite: these symbols are intended for encoding identification numbers and data supplementary to the identification. Each barcode consists of a linear component and a multi-row 2D Composite Component. The 2D Composite Component is printed above the linear component. The linear component can be any EAN-UCC or RSS linear symbol. The 2D component can be only of the following:
    • CC-A, encodes up to up to 56 digits.
    • CC-B, encodes up to up to 338 digits.
    • CC-C, up to 2 361 digits.

     

    Supported combinations of linear and multi-row symbols are:

    • UPC-A and EAN-13 with a CC-A or CC-B 2D component (4 columns).
    • EAN8 with a CC-A or CC-B 2D component (3 columns).
    • UPCE with a CC-A or CC-B 2D component (2 columns).
    • EAN128 with a CC-A or CC-B 2D component (4 columns).
    • EAN128 with a CC-C component.
    • RSS-14 with a CC-A or CC-B 2D component (4 columns).
    • RSS-14 Stacked with a CC-A or CC-B 2D component (2 columns).
    • RSS-14 Stacked Omni-directional with a CC-A or CC-B 2D component (2 columns).
    • RSS Limited with a CC-A or CC-B 2D component (3 columns).
    • RSS Expanded with a CC-A or CC-B 2D component (4 columns).
    • RSS Expanded Stacked with a CC-A or CC-B 2D component (4 columns).

The Delphi classes

This section explains how to use the classes in your application..

In order to create a barcode you must create an instance of one of the following classes:

  • TRSSBarcode1D: use this class to create EAN8, EAN13, EAN128, UPCE or UPCA symbols. Use the barType property to select the symbology to use.
  • TJ4LRSS: use this class to create RSS14, RSS stacked, RSS truncated or RSS stacked omni-directional symbols. Use the Format method to select the symbology to use.
  • TJ4LRSSLimited: use this class to create RSS Limited symbols.
  • TJ4LRSSExpanded : use this class to create RSS Expanded or Expanded Stacked symbols. Use the Format method to select the stacked or non-stacked format.

The following example creates a EAN128 barcode and exports it to a bmp file.

var
bmp:TBitmap;
bc:TRSSBarcode1D;
begin

bc := TRSSBarcode1D.create(nil);
bc.barType:=J4LSYMBOL_EAN128;
bc.Code:='0103212345678906';
bc.HumanReadableCode:='(01)03212345678906';

bmp:=TBitmap.create();
bmp.height:=200;
bmp.width:=600;
bc.paintBarcode(bmp.Canvas);
bmp.SaveToFile('barcode.bmp');

Possible values for the barType property are:

  • J4LSYMBOL_EAN13
  • J4LSYMBOL_UPCA
  • J4LSYMBOL_EAN8
  • J4LSYMBOL_UPCE
  • J4LSYMBOL_EAN128
  • J4LSYMBOL_RSS14. This value is automatically set when you create an instance of TJ4LRSS.
  • J4LSYMBOL_RSSLIMITED. This value is automatically set when you create an instance of TJ4LRSSLimited.
  • J4LSYMBOL_RSSEXPANDED. This value is automatically set when you create an instance of TJ4LRSSExpanded.


If you want to create a composite symbol you must set the value for the 2D component using the secondaryCode property. For example:


rss:=TJ4LRSS.create(nil);
rss.Format:=FORMAT_STACKED;
rss.Code:='0341234567890';
// Note: do not pass the 01 application identifier to RSS or RSSLimited classes.
rss.SecondaryCode:='17010200'; // this forces the 2D component to be created.

Possible values for the Format properties are listed below, please note the valid list of combinations:

  • FORMAT_REGULAR
  • FORMAT_TRUNCATED
  • FORMAT_STACKED
  • FORMAT_STACKED_OMNIDIRECTIONAL
  • FORMAT_LIMITED. This value is automatically set when you create an instance of TJ4LRSSLimited.
  • FORMAT_EXPANDED. This value is automatically set when you create an instance of TJ4LRSSExpanded.
  • FORMAT_EXPANDED_STACKED. This value is can be used in TJ4LRSSExpanded only.


Note that you should not pass the 01 application identifier nor the checksum character in the code property of the RSS or RSSLimited classes. You must however include all application identifiers for EAN128 and RSS Expanded symbols.


All linear symbols (except EAN128) can be associated with a CC-A or CC-B 2D component. The software will automatically select the correct component depending on the amount of data you need to encode.

EAN128 can be painted with a CC-A/B component or a CC-C component. In this case you must select the desired symbology using the EAN128WithCCC property. If you select CC-C you must also set the number of columns using the ccCColumns property (the default value is 4):

r := TRSSBarcode1D.create(nil);
r
.barType:=J4LSYMBOL_EAN128;
r.Code:='0193812345678901';
r.humanReadableCode:='(01)93812345678901';
// create a composite barcode
r.EAN128WithCCC:=true;
r.secondaryCode:='10ABCD123456#4103898765432108';

The following properties control the apereance of the barcode:
  • BarHeight: height in pixels of the 1D barcode.
  • BarHeight2D: height in pixels of the 2D component.
  • BackColor: background color.
  • BarColor: color of the bars.
  • FontColor: color of the font used for the human readable text.
  • Font: font used for the human readable text.
  • humanReadableCode: value to be printed as text below the barcode.
  • textOnTop: set it to true to print the human readable code above the barcode.
  • UPCESytem: system to be used in UPCE. It can be "0" or "1". The default is "1".
  • UPCEANSupplement2: 2 digit supplement for EAN or UPC codes.
  • UPCEANSupplement5: 5 digit supplement for EAN or UPC codes.
  • X: size in pixels of modules (narrow bars or spaces).
  • checkCharacter: if true, the checksum character will be calculated and appended to the code.
  • guardBars: if true (default), guardbars in EAN and UPC codes will be longer than data bars.