Plain English

Draws a 1D barcode at the specified position. The "type" string selects the symbology — 30 values are valid per TSPL2 PG §BARCODE, covering Code 128, Code 39, EAN/UPC families, CODABAR, ITF, MSI, Plessey, and US/Chinese postal codes. The engine validates the type at parse time and emits a "did you mean" diagnostic on unknown values.

When to use

When you need any 1D barcode — shipping labels, product IDs, inventory tracking. Pick the symbology with the "type" parameter; for 2D codes use QRCODE, DMATRIX, PDF417, AZTEC, etc.

Syntax

BARCODE x,y,"type",height,readable,rotation,narrow,wide,"data"

Parameters

ParameterDescription
x
Horizontal position in dots
y
Vertical position in dots
type
Barcode symbology. One of 30 values per TSPL2 PG §BARCODE p33–37.
  • "128" - Code 128 (auto-subset)
  • "128M" - Code 128 manual subset selection
  • "EAN128" - GS1-128 (EAN-128) with FNC1
  • "25" - Interleaved 2 of 5 (I2of5)
  • "25C" - Interleaved 2 of 5 with mod-10 checksum
  • "39" - Code 39 (standard)
  • "39C" - Code 39 with mod-43 checksum
  • "39S" - Code 39 full ASCII
  • "93" - Code 93
  • "EAN13" - EAN-13
  • "EAN13+2" - EAN-13 with 2-digit add-on
  • "EAN13+5" - EAN-13 with 5-digit add-on
  • "EAN8" - EAN-8
  • "EAN8+2" - EAN-8 with 2-digit add-on
  • "EAN8+5" - EAN-8 with 5-digit add-on
  • "CODA" - Codabar
  • "POST" - USPS Postnet
  • "UPCA" - UPC-A
  • "UPCA+2" - UPC-A with 2-digit add-on
  • "UPCA+5" - UPC-A with 5-digit add-on
  • "UPCE" - UPC-E
  • "UPCE+2" - UPC-E with 2-digit add-on
  • "UPCE+5" - UPC-E with 5-digit add-on
  • "CPOST" - China Post 25
  • "MSI" - MSI Plessey
  • "MSIC" - MSI Plessey with mod-10 check digit
  • "PLESSEY" - Plessey (UK)
  • "ITF14" - ITF-14 (case/carton code)
  • "EAN14" - EAN-14 (DUN-14)
  • "11" - Code 11
height
Barcode height in dots
readable
Human-readable text rendering mode
  • 0 - No human-readable text
  • 1 - Text below the barcode
  • 2 - Text above the barcode
  • 3 - Text both above and below
rotation
Rotation in degrees
  • 0 - No rotation (left to right)
  • 90 - 90° clockwise
  • 180 - 180° (upside down)
  • 270 - 270° clockwise (90° counter-clockwise)
narrow
Narrow bar width in dots
wide
Wide bar width in dots
data
The data to encode (in double quotes)

Example

BARCODE 50,200,"128",80,1,0,2,4,"ABC-12345"

Code 128 barcode with human-readable text below

Try it in the playground View all TSPL commands