CODE 16K

CODE 16K stacked barcode in PHP: row count, character set, code example and SVG output

CODE 16K stacks up to 16 rows of five CODE 128 characters, sharing one start pattern and one pair of check characters across the whole symbol. The row count follows from the payload length.

Type Token

ItemValue
Type tokenC16K
Enum caseBarcodeType::C16K
FamilyLinear
StandardANSI/AIM BC7, USS-16K
Class\Com\Tecnick\Barcode\Type\Linear\CodeOneSixK

Input

ItemValue
Character setthe 128 ASCII characters
Length2 to 16 rows of 5 characters
Checktwo check characters, modulo 107, computed by the library
Extra parametersnone

Examples

Text across several rows

<?php

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

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

echo $bobj->getInlineSvgCode();

CODE 16K barcode encoding ab0123456789

Errors

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

PayloadMessage
caf\xC3\xA9Invalid character sequence: 195

See Also