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
| Item | Value |
|---|---|
| Type token | DATABAR |
| Enum case | BarcodeType::DATABAR |
| Family | Linear |
| Standard | ISO/IEC 24724 |
| Class | \Com\Tecnick\Barcode\Type\Linear\GsOneDataBarOmni |
Input
| Item | Value |
|---|---|
| Character set | digits |
| Length | 13 digits, or 14 with a valid check digit |
| Check | modulo 10, appended when the payload is 13 digits and verified when it is 14 |
| Extra parameters | 1 (see below) |
Extra Parameters
Appended to the type token after commas, as in DATABAR,1.
| Position | Meaning | Values | Default |
|---|---|---|---|
| 1 | 2D component linkage flag | 1 sets the linkage bit | unset |
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();
Errors
These payloads raise \Com\Tecnick\Barcode\Exception:
| Payload | Message |
|---|---|
19501101530010 | Invalid check digit: 7 |
0950110153001A | Input code must be a number |
See Also
- tc-lib-barcode : the library overview.
- Rendering Options : size, colour, padding.
- Output Formats : every renderer.
- GS1 DataBar Truncated : the same data in a shorter symbol.
- GS1 DataBar Stacked : the two-row form.
- GS1 DataBar Expanded : the form that carries element strings.
- API reference : the generated class documentation.