Plain English

Draws a Data Matrix ECC 200 symbol — the compact square 2D barcode used for pharmaceutical labelling, automotive parts marking, and unit identification. (x,y) anchors the upper-left of the bounding rectangle; width × height define the maximum area the symbol may occupy. Real DataMatrix encoding is performed via `@rfid-me/epc-parser`. Per TSPL2 PG §DMATRIX (p47–48).

When to use

When you need a compact 2D barcode for small labels or high-density data — pharma serialisation (GS1 with FNC1 via `~1`), part marking, unit identification. For larger 2D codes use QRCODE; for 1D barcodes use BARCODE.

Syntax

DMATRIX x,y,width,height,[xm,row,col,]"data"

Parameters

ParameterDescription
x
Upper-left X coordinate of the bounding rectangle in dots
y
Upper-left Y coordinate of the bounding rectangle in dots
width
Maximum width of the bounding rectangle in dots
height
Maximum height of the bounding rectangle in dots
xm
Optional module size in dots (1–9)
row
Optional forced row count (must be a legal ECC 200 row size — 10, 12, 14, … 144)
col
Optional forced column count (must be a legal ECC 200 column size — 10, 12, 14, … 144)
data
Data to encode in double quotes. Use `~1` for FNC1 (GS1 application identifiers), `~d###` for ASCII decimal escape sequences

Example

DMATRIX 100,100,400,400,"DMATRIX EXAMPLE 1"

A Data Matrix encoding the string "DMATRIX EXAMPLE 1" within a 400×400 dot bounding rectangle (PG example)

Glossary entry

Try it in the playground View all TSPL commands