CODE 49

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

CODE 49 stacks two to eight rows of eight characters into a single symbol, which puts the full ASCII set into a footprint no single-row format can reach. It dates from 1987, before the matrix formats existed, and the library builds the row split and the check symbols for you.

Type Token

ItemValue
Type tokenC49
Enum caseBarcodeType::C49
FamilyLinear
StandardANSI/AIM BC6
Class\Com\Tecnick\Barcode\Type\Linear\CodeFourNine

Input

ItemValue
Character setthe printable ASCII characters
Length2 to 8 rows of 8 characters, filled automatically
Checktwo or three check symbols, computed by the library
Extra parametersnone

Examples

Several rows of text

<?php

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

$barcode = new \Com\Tecnick\Barcode\Barcode();
$bobj = $barcode->getBarcodeObj(
    type: 'C49',
    code: 'MULTIPLE ROWS IN CODE 49',
    width: -3,
    height: -3,
    color: 'black',
    padding: [0, 0, 0, 0],
)->setBackgroundColor('white');

echo $bobj->getInlineSvgCode();

CODE 49 barcode encoding MULTIPLE ROWS IN CODE 49

Errors

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

PayloadMessage
MULTIPLE ROWS IN CODE 49 WITH A PAYLOAD TOO LONG FOR EIGHT ROWS OF EIGHT CHARACTERSThe code is too long: 83 code characters (maximum 49)

See Also