MSI

MSI barcode in PHP: character set, length, code example and SVG output

MSI, a variation on the Plessey code, was made for shelf edge labels and inventory tags rather than for anything that travels. Each character is four bits drawn as four bar and space pairs.

Type Token

ItemValue
Type tokenMSI
Enum caseBarcodeType::MSI
FamilyLinear
Class\Com\Tecnick\Barcode\Type\Linear\Msi

Input

ItemValue
Character set0-9 and A-F
Length1 to 30000 characters
Checknone. Use MSI+ for the modulo 11 check digit
Extra parametersnone

Examples

Ten digits

<?php

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

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

echo $bobj->getInlineSvgCode();

MSI barcode encoding 0123456789

Errors

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

PayloadMessage
GHIInvalid character: 71

See Also