Sign In
Products
ZPL ViewerBarcode GeneratorImage → ZPLZPL cheat sheetLabel DesignerTemplate Gallery
Developers
API QuickstartAPI ReferenceMCP ServerBulk GenerationWebhooksSDKs & ExamplesLimitsDirectPrint agent NewGitHub ActionVS Code extensionOn-Premise
Solutions
Logistics & ShippingE-CommerceERP & WMSManufacturingRetailHealthcare & LaboratoryAll solutions
Tools
ZPL Diagnostics HubZPL DebuggerSize & DPI AnalyzerDPI ConverterBarcode fit calculatorShipping Label AnalyzerFont InspectorOrientation DebuggerCalibration AssistantPrinter Compatibility CheckerBarcode Readability CheckerPrinter Language DetectorThermal Printer Test PackZPL ToolsEPL ToolsTSPL ToolsCPCL ToolsPrinter Language ConverterAll ToolsGuidesPricing
Language
EnglishTürkçeDeutsch
Home›All TSPL commands›BARCODE

BARCODE — Barcode

Draws a 1D barcode: type, height, human-readable flag, rotation, narrow and wide bar width come from parameters.

Engine status: Partially rendered

The command is drawn but some of its parameters are ignored; the detail is in the note below.

Syntax

BARCODE x, y, "type", h, readable, rot, n, w, "data"

Example

SIZE 100 mm, 150 mm
GAP 3 mm, 0 mm
CLS
BARCODE 100, 200, "128", 100, 1, 0, 3, 3, "123456"
PRINT 1

Open this example in the preview →

Open the validator →

Rendered example

BARCODE 100, 200, "128", 100, 1, 0, 3, 3, "123456"

Output of the example above in our renderer (203 dpi). Not verified on a physical printer.

Parameters

ParameterMeaning
x, yTop-left corner of the barcode, in dots
"type"Symbology in double quotes; the preview draws 128, 39, EAN13 and UPCA
hBar height in dots
readable0 hides the human-readable line; the preview prints it for any other value
rotRotation in degrees clockwise: 0, 90, 180 or 270
nNarrow bar width in dots; sets the module width
wWide bar width in dots; accepted but not used by the Labelixa preview
"data"Barcode data in double quotes; empty data is skipped with a warning

Common mistake

Using EPL type codes: TSPL names the symbology, so Code 128 is "128", not "1". With "1" the preview skips the barcode with an unsupported-type warning.

The same job in other languages

ZPL equivalent: ^BY · ^BC · EPL B · Language comparison

All TSPL commands

SIZE · GAP · REFERENCE · CLS · TEXT · QRCODE · BOX · BAR · BITMAP · PRINT · DIRECTION · DENSITY · SPEED · OFFSET · SET · CODEPAGE · BLINE

All TSPL commands