Plain English

Draws a 1D barcode at the specified position. TSPL supports many barcode types including Code 128, Code 39, EAN-13, UPC-A, and more. The "type" string selects the symbology.

When to use

When you need any 1D barcode — shipping labels, product IDs, inventory tracking.

Syntax

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

Parameters

ParameterDescription
xHorizontal position in dots
yVertical position in dots
typeBarcode type: "128", "39", "EAN13", "UPCA", "93", "CODABAR", etc.
heightBarcode height in dots
readable0 = no human-readable text, 1 = text below, 2 = text above, 3 = both
rotation0, 90, 180, or 270 degrees
narrowNarrow bar width in dots
wideWide bar width in dots
dataThe 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