GS1 DataBar Expanded

GS1 DataBar Expanded barcode in PHP: element string input, capacity, code examples and SVG output

The only member of the DataBar family that carries more than a GTIN. It takes the same bracketed element string as GS1-128, compacts it, and draws it in 4 to 22 symbol characters.

Capacity is counted in bits rather than characters, up to 252 of them, because the compaction depends on what the Application Identifiers are: a price field costs less than free text.

Type Token

ItemValue
Type tokenDATABAREXP
Enum caseBarcodeType::DATABAREXP
FamilyLinear
StandardISO/IEC 24724
Class\Com\Tecnick\Barcode\Type\Linear\GsOneDataBarExpanded

Input

ItemValue
Character setthe printable ASCII characters, in the bracketed element string form
Length4 to 22 symbol characters, up to 252 bits of compacted data
Checkper Application Identifier, where the definition specifies one
Extra parametersnone

Examples

A GTIN and a weight

<?php

require_once __DIR__ . '/vendor/autoload.php';

$barcode = new \Com\Tecnick\Barcode\Barcode();
$bobj = $barcode->getBarcodeObj(
    type: 'DATABAREXP',
    code: '(01)90614141000015(3202)000150',
    width: -3,
    height: -3,
    color: 'black',
    padding: [0, 0, 0, 0],
)->setBackgroundColor('white');

echo $bobj->getInlineSvgCode();

GS1 DataBar Expanded barcode encoding (01)90614141000015(3202)000150

Errors

These payloads raise \Com\Tecnick\Barcode\Exception:

PayloadMessage
(01)9061414100001AThe data field of the Application Identifier (01) must be a number

See Also