Pharmacode represents a single integer as a sequence of thin and thick bars, read from right to left. There is no character set behind it, no start or stop pattern and no check digit.
The design target was verification on a packaging line: the symbol can be printed in any colour on any background, and a reader only has to distinguish two bar widths. PHARMA-CODE is a trademark of Laetus GmbH.
Type Token
| Item | Value |
|---|---|
| Type token | PHARMA |
| Enum case | BarcodeType::PHARMA |
| Family | Linear |
| Class | \Com\Tecnick\Barcode\Type\Linear\Pharma |
Input
| Item | Value |
|---|---|
| Character set | digits, read as one integer |
| Length | a value from 3 to 131070 |
| Check | none |
| Extra parameters | none |
Examples
A value in the middle of the range
<?php
require_once __DIR__ . '/vendor/autoload.php';
$barcode = new \Com\Tecnick\Barcode\Barcode();
$bobj = $barcode->getBarcodeObj(
type: 'PHARMA',
code: '123456',
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 |
|---|---|
2 | Invalid barcode value: the code must be an integer between 3 and 131070 |
131071 | Invalid barcode value: the code must be an integer between 3 and 131070 |
See Also
- tc-lib-barcode : the library overview.
- Rendering Options : size, colour, padding.
- Output Formats : every renderer.
- Pharmacode Two-Track : the two-track form, with a wider range.
- API reference : the generated class documentation.