Matrix 2 of 5 carries data in the spaces as well as the bars, so the same digits fit into noticeably less width than Standard 2 of 5 needs.
Type Token
| Item | Value |
|---|---|
| Type token | S25MATRIX |
| Enum case | BarcodeType::S25MATRIX |
| Family | Linear |
| Class | \Com\Tecnick\Barcode\Type\Linear\MatrixTwoOfFive |
Input
| Item | Value |
|---|---|
| Character set | digits |
| Length | 1 to 30000 characters |
| Check | none |
| Extra parameters | none |
Examples
Ten digits
<?php
require_once __DIR__ . '/vendor/autoload.php';
$barcode = new \Com\Tecnick\Barcode\Barcode();
$bobj = $barcode->getBarcodeObj(
type: 'S25MATRIX',
code: '0123456789',
width: -3,
height: -30,
color: 'black',
padding: [0, 0, 0, 0],
)->setBackgroundColor('white');
echo $bobj->getInlineSvgCode();
Errors
These payloads raise \Com\Tecnick\Barcode\Exception:
| Payload | Message |
|---|---|
12A | Invalid character: 65 |
See Also
- tc-lib-barcode : the library overview.
- Rendering Options : size, colour, padding.
- Output Formats : every renderer.
- Standard 2 of 5 : the wider bars-only form.
- Interleaved 2 of 5 : the other compact numeric format.
- API reference : the generated class documentation.