DocEngine

Field types · Barcode

Barcode barcode

Drag-and-drop native barcode field. The stored value is the string to encode; the token renders a generated barcode/QR image (bwip-js) as field-token--image + field-token--barcode.

At a glance

  • Schema type: barcode
  • Value: string (payload to encode)
  • Use when: Scannable Code 128, QR, EAN-13, or Code 39 printed on the document face.

Type properties

Options that appear only for Barcode fields. Shared options (Label, Field Name, Required, …) are on Field types → Common properties.

Symbology
Barcode format: Code 128, QR Code, EAN-13, or Code 39 (default Code 128).
Max width (px)
Maximum rendered width of the barcode image (default 180).
Bar height
1D bar height in bwip-js units. Ignored for QR codes (default 10).
Show value under bars
When on (default), human-readable text appears under 1D barcodes. Typically off or ignored for QR.
Quiet zone
When on (default), includes quiet-zone margins around the barcode for reliable scanning.

Details

  • Built-in inline field. Value is the scalar string to encode — not an image URL.
  • Symbologies: code128 (default), qr, ean13, code39.
  • Fill mode reuses the text picker so users type or paste the payload; Mapping uses a scalar $payload… path (same pattern as Text).
  • Schema controls symbology, maxWidth (default 180), height for 1D bars (default 10; ignored for QR), displayValue (human-readable text under 1D bars), and quietZone.
  • Invalid codes (e.g. bad EAN-13 checksum) show the raw value plus an error hint — they do not throw or block PDF generation.
  • Editor, HTML preview, and PDF all render the generated barcode image from the same schema + value.

Schema

TypeScript (editor package)

type BarcodeSymbology = 'qr' | 'code128' | 'ean13' | 'code39';

interface BarcodeFieldSchema extends FieldSchemaBase {
  type: 'barcode';
  symbology?: BarcodeSymbology; // default 'code128'
  maxWidth?: number;            // default 180
  height?: number;              // 1D bar height (bwip-js units); ignored for QR
  displayValue?: boolean;       // human-readable text under 1D bars (default true)
  quietZone?: boolean;          // default true
}

Value example

{
  "sections": {
    "Shipping": {
      "Tracking barcode": "1Z999AA10123456784",
      "Product QR": "https://example.com/p/42"
    }
  }
}

Symbologies

  • Code 128 — default; general-purpose alphanumeric 1D barcode.
  • QR Code — 2D matrix; height is ignored; maxWidth controls size.
  • EAN-13 — retail product codes; invalid checksum shows a placeholder hint instead of throwing.
  • Code 39 — common industrial 1D symbology.

Fill & mapping

Users enter the encode string via the text picker (or leave it mapped). Mapping is a normal scalar path — e.g. $payload.TrackingNumber — same as Text fields. The barcode image is generated at render time from that string and the schema options.

Invalid values

When the string cannot be encoded for the chosen symbology, DocEngine shows the raw value with an error hint in the token. Document finish / PDF still proceeds so a bad code does not hard-fail the pipeline.

Related

Other field types

← All field types