Skip to main content

Barcodes

Barcodes are embedded inline within paragraph text and rendered into the PDF or DOCX output. The API supports 63 symbologies spanning retail, logistics, healthcare, postal, automotive, and specialty industrial use cases — covering ISO-compliant quiet zones and check-digit handling out of the box.

Live catalog

Every supported symbology with a sample rendering. Open the Template tab to see the source JSON, or Try in Playground to edit it live. The same catalog also lives as a standalone tutorial at Barcode Catalog.

Inline syntax

[barcode, type, payload]
[barcode, type, payload, width|height]
[barcode, type, payload, width|height, slot, slot, ...]

The first three slots are positional. The rest are content-discriminated and order-independent.

SlotDescription
typeSymbology name (e.g. qrcode, code128, gs1-128, hibc-dm). Case-insensitive; common aliases supported. See Symbologies.
payloadThe data to encode.
width|heightOptional on-page dimensions in points. Falls back to per-symbology defaults — see Options & defaults.
#hexOptional foreground color override (e.g. #1A1A2E).
#fg|#bgOptional foreground + background pair.
quiet=NOptional quiet-zone override in module multiples.
key=valueRenderer-specific knobs (escape hatch for advanced options).

Quick start

{ "p": "Scan to track: [barcode, qrcode, https://track.docpayload.example/DOC-2026-04521, 100|100]" }

Code 128 shipping label

{ "p": "[barcode, code128, DOC-2026-04521, 200|50]" }

GS1-128 with bracketed Application Identifiers

{ "p": "[barcode, gs1-128, [01]04150123456789[17]270630[10]A4521, 220|50]" }

The inline tag parser handles bracketed AIs natively — no escaping required.

Brand-tinted QR

{ "p": "[barcode, qrcode, https://docpayload.example, 80|80, #1A1A2E]" }

Barcodes in table cells

{
"table": {
"widths": [2, 1, 2],
"rows": [
[
{ "p": "[b]Shipment[/b]" },
{ "p": "[b]Service[/b]" },
{ "p": "[b]Tracking[/b]" }
],
[
{ "p": "DOC-CA-2026-04521" },
{ "p": "Express" },
{ "p": "[barcode, code128, DOC-CA-2026-04521, 120|35]" }
]
]
}
}

Barcodes in columns layouts

{
"columns": {
"widths": [2, 1],
"gap": 20,
"rows": [
[
{ "p": "[b]Shipment Details[/b]" },
{ "p": "From: Toronto, ON" },
{ "p": "To: San Francisco, CA" }
],
[
{ "p": "[barcode, qrcode, https://track.docpayload.example/DOC-CA-2026-04521, 100|100]" },
{ "p": "[fontsize, 8]Scan to track[/fontsize]" }
]
]
}
}

Barcodes with data references

Barcode payloads can be populated from $data references at render time:

{ "p": "[barcode, qrcode, $data.shipment.trackingUrl, 80|80]" }
{ "p": "[barcode, code128, $data.shipment.trackingId, 180|45]" }

DataMatrix shape inference

DataMatrix supports both square and rectangular variants. Equal W==H produces a square; unequal W!=H produces a rectangular variant. No explicit keyword needed — the dimensions speak for themselves.

{ "p": "Square: [barcode, datamatrix, X, 80|80] Rectangular: [barcode, datamatrix, X, 100|40]" }

What's next

  • Symbologies — full reference of all 63 supported types organized by family.
  • Options & defaults — per-symbology default sizes, quiet zones, color overrides, error handling.