CODE 128 B

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

CODE 128 restricted to subset B, the printable ASCII range from space to tilde. This is the subset that carries lower case, and the one to fix when the payload is free text.

Type Token

ItemValue
Type tokenC128B
Enum caseBarcodeType::C128B
FamilyLinear
StandardISO/IEC 15417
Class\Com\Tecnick\Barcode\Type\Linear\CodeOneTwoEight\CodeOneTwoEightB

Input

ItemValue
Character setASCII 32 to 126: space through ~
Length1 to 30000 characters
Checkmodulo 103, computed by the library
Extra parametersnone

Examples

Lower case text

<?php

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

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

echo $bobj->getInlineSvgCode();

CODE 128 B barcode encoding tc-lib-barcode

Errors

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

PayloadMessage
caf\xC3\xA9Invalid character sequence: 195

See Also