GS1 DataBar Truncated

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

Same encoding as the omnidirectional form, at 13 modules high instead of 33. Reading it needs a handheld scanner aimed across the bars, which is the trade for the height it saves.

Type Token

ItemValue
Type tokenDATABARTRUNC
Enum caseBarcodeType::DATABARTRUNC
FamilyLinear
StandardISO/IEC 24724
Class\Com\Tecnick\Barcode\Type\Linear\GsOneDataBarTruncated

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 DATABARTRUNC,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: 'DATABARTRUNC',
    code: '00012345678905',
    width: -3,
    height: -3,
    color: 'black',
    padding: [0, 0, 0, 0],
)->setBackgroundColor('white');

echo $bobj->getInlineSvgCode();

GS1 DataBar Truncated barcode encoding 00012345678905

Errors

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

PayloadMessage
0950110153001AInput code must be a number

See Also