Pharmacode Two-Track

Two-track Pharmacode barcode in PHP: value range 4 to 64570080, code example and SVG output

The two-track form gives each position three states instead of two: a bar in the upper track, in the lower track, or spanning both. That widens the range to 64570080 without making the symbol longer.

Type Token

ItemValue
Type tokenPHARMA2T
Enum caseBarcodeType::PHARMA2T
FamilyLinear
Class\Com\Tecnick\Barcode\Type\Linear\PharmaTwoTracks

Input

ItemValue
Character setdigits, read as one integer
Lengtha value from 4 to 64570080
Checknone
Extra parametersnone

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

echo $bobj->getInlineSvgCode();

Pharmacode Two-Track barcode encoding 123456

Errors

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

PayloadMessage
3Invalid barcode value: the code must be an integer between 4 and 64570080
64570081Invalid barcode value: the code must be an integer between 4 and 64570080

See Also