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
| Item | Value |
|---|---|
| Type token | DATABAREXP |
| Enum case | BarcodeType::DATABAREXP |
| Family | Linear |
| Standard | ISO/IEC 24724 |
| Class | \Com\Tecnick\Barcode\Type\Linear\GsOneDataBarExpanded |
Input
| Item | Value |
|---|---|
| Character set | the printable ASCII characters, in the bracketed element string form |
| Length | 4 to 22 symbol characters, up to 252 bits of compacted data |
| Check | per Application Identifier, where the definition specifies one |
| Extra parameters | none |
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();
Errors
These payloads raise \Com\Tecnick\Barcode\Exception:
| Payload | Message |
|---|---|
(01)9061414100001A | The data field of the Application Identifier (01) must be a number |
See Also
- tc-lib-barcode : the library overview.
- Rendering Options : size, colour, padding.
- Output Formats : every renderer.
- GS1 DataBar Expanded Stacked : the same data over several rows.
- GS1-128 : the other element string format.
- GS1 DataBar Omnidirectional : the fixed GTIN form.
- API reference : the generated class documentation.