GS1 DataBar Omnidirectional

GS1 DataBar Omnidirectional barcode in PHP: 14 digit GTIN input, check digit, code example and SVG output

GS1 DataBar was designed for the things EAN and UPC symbols do not fit: loose produce, small pharmaceutical packs, coupons. It carries a full GTIN-14 in a symbol 96 modules wide.

The omnidirectional variant is 33 modules high, enough for a slot scanner to read it at any orientation.

Type Token

ItemValue
Type tokenDATABAR
Enum caseBarcodeType::DATABAR
FamilyLinear
StandardISO/IEC 24724
Class\Com\Tecnick\Barcode\Type\Linear\GsOneDataBarOmni

Input

ItemValue
Character setdigits
Length13 digits, or 14 with a valid check digit
Checkmodulo 10, appended when the payload is 13 digits and verified when it is 14
Extra parameters1 (see below)

Extra Parameters

Appended to the type token after commas, as in DATABAR,1.

PositionMeaningValuesDefault
12D component linkage flag1 sets the linkage bitunset

Examples

A GTIN-14

<?php

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

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

echo $bobj->getInlineSvgCode();

GS1 DataBar Omnidirectional barcode encoding 09501101530010

Errors

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

PayloadMessage
19501101530010Invalid check digit: 7
0950110153001AInput code must be a number

See Also