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 CPCL commands›BARCODE

BARCODE — Barcode

Draws a barcode: type, narrow bar width, ratio, height and position come from parameters; the data ends the line.

Engine status: Partially rendered

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

Syntax

BARCODE <type> <narrow> <ratio> <h> <x> <y> <data>

Example

! 0 200 200 210 1
PAGE-WIDTH 576
BARCODE 128 1 1 100 50 150 123456
PRINT

Open this example in the preview →

Open the validator →

Rendered example

BARCODE 128 1 1 100 50 150 123456

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

Parameters

ParameterMeaning
typeSymbology; the preview draws 128, 39, EAN13 and UPCA
narrowNarrow bar width in dots; sets the module width
ratioWide-to-narrow ratio; accepted but not used by the Labelixa preview
hBar height in dots
x yTop-left corner of the barcode in dots — AFTER the size fields
dataThe rest of the line; the preview draws no human-readable line under it

Common mistake

Putting x y first as in TSPL: CPCL expects type, narrow, ratio and height before the position; BARCODE 50 150 128 1 1 100 123456 names type 50 and is skipped.

The same job in other languages

ZPL equivalent: ^BC · ^BY · Language comparison

All CPCL commands

! · PAGE-WIDTH · TEXT · TEXT90 · TEXT180 · TEXT270 · LINE · BOX · EXPANDED-GRAPHICS · PRINT · FORM · CONTRAST · TONE · SPEED · JOURNAL · SETMAG · CENTER

All CPCL commands