CODE 128 A

CODE 128 subset A barcode in PHP: character set, length, code example and SVG output

CODE 128 restricted to subset A: digits, upper case letters, punctuation and the ASCII control characters. No lower case. Fixing the subset keeps every symbol the same width per character, which matters when a label layout is fixed in advance.

Type Token

ItemValue
Type tokenC128A
Enum caseBarcodeType::C128A
FamilyLinear
StandardISO/IEC 15417
Class\Com\Tecnick\Barcode\Type\Linear\CodeOneTwoEight\CodeOneTwoEightA

Input

ItemValue
Character setASCII 0 to 95: space through _, plus the control characters
Length1 to 30000 characters
Checkmodulo 103, computed by the library
Extra parametersnone

Examples

Digits and upper case

<?php

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

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

echo $bobj->getInlineSvgCode();

CODE 128 A barcode encoding TCPDF-2026

Errors

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

PayloadMessage
abcInvalid character sequence

See Also