PLANET

PLANET barcode in PHP: numeric input, check digit, code example and SVG output

PLANET is POSTNET with the tall and short bars exchanged: three tall bars per digit instead of two. The USPS used it to track mail through the network rather than to route it, and retired both formats together.

Type Token

ItemValue
Type tokenPLANET
Enum caseBarcodeType::PLANET
FamilyPostal
StandardUSPS-B-3200
Class\Com\Tecnick\Barcode\Type\Linear\Planet

Input

ItemValue
Character setdigits
Length11 or 13 digits in practice; the library accepts any number of them
Checkmodulo 10, appended by the library
Extra parametersnone

Examples

A tracking number

<?php

require_once __DIR__ . '/vendor/autoload.php';

$barcode = new \Com\Tecnick\Barcode\Barcode();
$bobj = $barcode->getBarcodeObj(
    type: 'PLANET',
    code: '0123456789',
    width: -3,
    height: -30,
    color: 'black',
    padding: [0, 0, 0, 0],
)->setBackgroundColor('white');

echo $bobj->getInlineSvgCode();

PLANET barcode encoding 0123456789

Errors

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

PayloadMessage
1234AInvalid character: 65

See Also