Databar Expanded

Generally used for coupons and variable weight items.
Can encode a fixed amount of data.
Data input must follow the GS1 Standard; SSC identifier must be registered.
Contains Expanded and Expanded Stacked versions.

Demonstration

* 200 character limit for this demo.

<?php
require_once('class/BCGColor.php');
require_once('class/BCGDrawing.php');
require_once('class/BCGdatabarexpanded.barcode.php');

$colorFront = new BCGColor(0, 0, 0);
$colorBack = new BCGColor(255, 255, 255);

// Barcode Part
$code = new BCGdatabarexpanded();
$code->setScale(1);
$code->setStacked(1);
$code->setLinkageFlag(false);
$code->setColor($colorFront, $colorBack);
$code->parse('240HELLO');

// Drawing Part
$drawing = new BCGDrawing('', $colorBack);
$drawing->setBarcode($code);
$drawing->draw();

header('Content-Type: image/png');

$drawing->finish(BCGDrawing::IMG_FORMAT_PNG);
?>

Technical Specifications

Databar Expanded (formerly known as RSS Expanded) is an ISO international standard (IEC 24724). You are allowed to use it in your applications.

In order to use a SSC identifier, you must register with your GS1 organization.

A Databar code is composed of one or multiple identifiers. The identifiers are specified by the GS1 organization; some of them must follow a pattern (see the {0} for more details). Failure to comply with the standard may result in an unreadable barcode.
manual

Some identifiers are encoded better than others. This means that your barcode will be smaller in size if you follow the recommendations.

Data Encodation

By using different modes, you may be able to encode your data more efficiently. The following list is ordered from the most compressed to the least compressed size.

  • 01 and 3103: Encodes SSC and variable weight item (0.001 kilogram increments); (fixed length)
    • The AI 01 item identification element string must have an Indicator digit of 9.
    • The AI 3103 variable weight element string must specify a weight no more than 32.767 kilograms.
    Example: 01900123456789083103001750
  • 01 and 3202/3203: Encodes SSC and variable weight item (0.01 or 0.001 pound increments); (fixed length)
    • The AI 01 item identification element string must have an Indicator digit of 9.
    • The AI 3202 variable weight element string must specify a weight no more than 99.99 pounds.
    • The AI 3203 variable weight element string must specify a weight no more than 22.767 pounds.
    Example: 01900123456789083202000156
  • 01 and 310x/320x and 11/13/15/17: Encodes SSC and variable weight item plus a date; (fixed length)
    • The AI 01 item identification element string must have an Indicator digit of 9.
    • For 310x and 320x, x ranges from 0 to 9.
    • 310x: Metric weight.
    • 320x: English (Standard) weight.
    • 11: Production date.
    • 13: Packaging date.
    • 15: Best before date.
    • 17: Expiration date.
    • Date is optional; shall be in the format YYMMDD. MM starts with 01. DD can be 00.
    Example: 0190012345678908310301223315991231
  • 01 and 392x: Encodes SSC and variable measure item and price; (variable length)
    • The AI 01 item identification element string must have an Indicator digit of 9.
    • The AI 392x price may only have from zero to three digits to the right of the decimal point (x = 0 to 3).
    Example: 01900123456789083922795
  • 01 and 393x: Encodes SSC and variable measure item and price with ISO 4217; (variable length)
    • The AI 01 item identification element string must have an Indicator digit of 9.
    • The AI 393x price may only have from zero to three digits to the right of the decimal point (x = 0 to 3).
    • The ISO 4217 is composed of 3 digits.
    Example: 019001234567890839320401234
  • 01 and other AIs: Encodes SSC and any other AIs; (variable length)
    • The AI 01 item identification element string doesn't have any limitations. However, it must contain 14 digits.
    • Any other AIs following the 01 AI.
    Example: 010001234567890510ABC123
  • any AIs: Encodes any AIs with low compression; (variable length)
    • Any AIs can be encoded.
    • Very low compression is used.
    Example: 240HELLO

Details

Databar Expanded exists in two modes, Expanded and Expanded Stacked. Both modes encode the same amount of data; the stacked version can be used when the space is not wide enough to fit the barcode. It can be spread across 11 lines.
Some encodation can be split better than others; in general, the fixed length barcodes can be split in 2 lines maximum.

Expanded Non-Stacked
Expanded Stacked

For variable length modes, there are 3 types of characters that can be encoded. Each of them is encoded with a different number of bits. Note that the alphanumeric type doesn't contain lowercase letters or spaces. If you wish to encode lowercase letters, it will be encoded using the ISO/IEC 646 type. Barcode Bakery will always attempt to generate the smallest bitstream possible while conserving all your data. The types are listed below in size order.

  • Numeric: Encodes digits, [0-9]. 2 digits represent 7 bits.
  • Alphanumeric: Encodes 41 characters. [0-9] [A-Z] * , - . /. Digits are encoded in 5 bits, the rest in 6 bits.
  • ISO/IEC 646: Encodes 83 characters. [0-9] [A-Za-z] ! " % & ' ( ) * + , - . / : ; < = > ? _ [SPACE]. Digits are encoded in 5 bits, letters in 7 bits, the rest 8 bits.
* All modes can encode FNC1 with ~F1 special character.

A linkage flag can be used if you print the barcode aside an EAN/UCC barcode. This doesn't change the size of your barcode.

Barcode Bakery Supports

Supports
Encodes all type of AIs Available
Encodes FNC1 Available
Encodes Stacked Available
Specific to .NET package
.NET 2.0+ Available