Data Matrix Rectangular Extension

DMRE barcode in PHP: the 18 rectangular symbol sizes, encoding schemes, code examples and SVG output

Standard Datamatrix offers six rectangular sizes. The rectangular extension adds a further set, from 8 by 48 up to 26 by 64, for marking surfaces that are long and thin: cables, pins, the edge of a circuit board. Leave the size parameter empty and the library picks the smallest that fits.

Type Token

ItemValue
Type tokenDMRE
Enum caseBarcodeType::DMRE
Family2D
StandardISO/IEC 21471
Class\Com\Tecnick\Barcode\Type\Square\Dmre

Input

ItemValue
Character setany byte sequence
Lengthup to 172 characters, depending on the symbol size
CheckReed-Solomon error correction, computed by the library
Extra parameters3 (see below)

Extra Parameters

Appended to the type token after commas, as in DMRE,N,ASCII,8x144.

PositionMeaningValuesDefault
1encoding modeN for the normal mode, GS1 for element stringsN
2encoding schemeASCII, C40, TXT, X12, EDF, BASE256ASCII
3symbol sizeone of the 18 sizes, such as 8x144automatic

Examples

The smallest size that fits

<?php

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

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

echo $bobj->getInlineSvgCode();

Data Matrix Rectangular Extension barcode encoding A1B2C3D4E5F6G7H8I9J0K1L2

A fixed 8 by 144 symbol

$bobj = $barcode->getBarcodeObj(
    type: 'DMRE,N,ASCII,8x144',
    code: 'A1B2C3D4E5F6G7H8I9J0K1L2',
    width: -4,
    height: -4,
    color: 'black',
    padding: [0, 0, 0, 0],
)->setBackgroundColor('white');

Data Matrix Rectangular Extension barcode encoding A1B2C3D4E5F6G7H8I9J0K1L2

Errors

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

PayloadMessage
``Empty input

See Also