CODE 93

CODE 93 barcode in PHP: full ASCII character set, check characters, code example and SVG output

CODE 93 was designed to replace CODE 39 where width mattered: nine modules per character against thirteen or more, two check characters instead of none, and the same full ASCII reach through shift pairs. Every character is drawn as three bars and three spaces, which also makes the symbol self-checking.

Type Token

ItemValue
Type tokenC93
Enum caseBarcodeType::C93
FamilyLinear
StandardUSS-93
Class\Com\Tecnick\Barcode\Type\Linear\CodeNineThree

Input

ItemValue
Character setthe 128 ASCII characters
Length1 to 30000 characters
Checktwo check characters, C and K, appended by the library
Extra parametersnone

Examples

Digits

<?php

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

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

echo $bobj->getInlineSvgCode();

CODE 93 barcode encoding 0123456789

Mixed case text

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

CODE 93 barcode encoding tc-lib-barcode

Errors

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

PayloadMessage
caf\xC3\xA9Invalid character: 195

See Also