How it works

From template to printed label

One layout feeds the preview, the exports and the printer commands. This page follows a label from your template and data to a printer, and back as a job status, and says where each step runs.

What is built today: Status

Your infrastructureBarcoderX runs entirely on infrastructure you operate: your application, your API server and your network. It hosts nothing for you, and no label data is sent to BarcoderX.

The path at a glance

Six steps, in the same order whether you start from your own .NET code or from the REST API. The numbers in the diagram match the steps below.

Schematic of the path from template to printed label, inside your infrastructure Everything in the diagram runs on infrastructure you operate. A template and your data go into the engine, in your application or on your API server, which lays the label out once. From that one layout come a preview and exports, and printer commands in ZPL or EPL. The commands reach the printer by one of two routes: directly from your application over TCP port 9100, serial, the Windows spooler, CUPS or USB, or through your API server and its job queue to a print agent on the printer network that only dials out. The printer prints, and its status comes back. YOUR INFRASTRUCTURE Template JSON or XML Data objects, DataTable, CSV, JSON, XML 1 Engine: one layout in your application or your API server 2 Preview and exports 1bpp bitmap, PDF, PNG, JPG, SVG, PCX, HTML 3 Printer commands ZPL or EPL 4 A · DIRECT B · VIA YOUR SERVER From your application TCP 9100, serial, Windows spooler, CUPS or USB API server on your host, with a job queue Print agent on the printer network, dials out only 5 raw bytes raw bytes Printer prints the label Status comes back printer status over TCP, serial or USB; queue state on spooler or CUPS; jobs on the API server: Queued to Printed 6
Schematic. Everything inside the dashed line runs on infrastructure you operate. BarcoderX operates nothing outside it.
  1. Template and dataA JSON or XML template, and records from your own data.
  2. One layoutThe engine lays the label out once, in physical units.
  3. Preview and exportsA 1bpp bitmap preview and six file formats read that one layout.
  4. Printer commandsThe same layout becomes ZPL or EPL: native where it is proven equal, raster where it must be.
  5. Reaching the printerDirect from your application, or through your API server and a print agent that only dials out.
  6. StatusThe printer's own status where the transport allows it, and a visible life cycle for every queued job.

The six steps

Template and data

Runs in your application, or on your API server

A template describes the label: its size and its elements. There are ten element kinds: text, barcode, picture, line, box, ellipse, grid, repeater, RFID and raw command. JSON is the canonical template format, with an XML projection, and every released schema version keeps loading in every later build. You can also build the label in C#, in an application that targets .NET 10, instead of loading a template.

The data comes from objects, a DataTable, CSV, JSON or XML. Counters, masks and more than 100 built-in functions produce the values that change on every label.

The SDK packages Data and expressions in the editor Templates and data in depth Fonts and accents

One layout

Runs in the same process as step 1

The engine resolves the template against your data and lays the label out once, in physical units: millimeters, inches or dots, at any resolution from 96 to 1,200 dpi. That single result is the only thing the next steps read. The canvas, the bitmap and the printer commands cannot drift apart, because none of them has layout code of its own.

The same template gives the same output on every supported platform: Windows x64, Linux x64 and Linux arm64.

Preview and exports

Runs in the same process as step 1

From that layout the engine draws the preview: the true 1bpp bitmap at the printer's resolution, where every dot is ink or paper and the bars sit on whole dots. The same layout also exports to six file formats.

The six export formats and what each one contains
FormatWhat you get
PDFVector, with searchable text and subset fonts embedded.
PNGRGBA, gray or 1bpp, at the DPI you ask for.
JPGBaseline, with a quality setting.
SVGPaths and images only. No scripts.
PCX1bpp, run-length encoded.
HTMLOne file, no scripts, with a strict content policy.

Many labels at once come out as one multi-page PDF or as a ZIP of files. Output is deterministic: the same input gives the same bytes.

Printer languages and exports

Printer commands: native where proven, raster where it must

Runs in the same process as step 1

For the printer commands, the engine asks the printer's profile how each element can be drawn. A profile records the printer's resolution, print width and memory, features such as UTF-8, RFID and cutter, its resident fonts, and which native barcodes are equivalent to the preview. Generic profiles are built in for ZPL at 203, 300 and 600 dpi and for EPL at 203 and 300 dpi, and model-specific profiles come from lab measurements.

Every element then lands on one of four outcomes.

The four outcomes for each element on the label
OutcomeWhat happens
NativeThe printer draws it with its own command. Only when the profile marks the command equal to the preview and, for barcodes, a lab scan agrees.
Native, approximateText in a printer-resident font. The preview shows a substitute, and the editor flags the element with a badge.
RasterThe engine draws the dots at the printer's resolution and sends them as a graphic. This is what keeps the print identical to the preview.
UnsupportedNeither is possible. The job is rejected with a diagnostic, instead of printing something different.

Fidelity is the default intent: the print looks like the preview, and native commands are used only where they are proven equal. A second intent, native preferred, favors printer-side commands. An output hint on each element can ask for Auto, Native or Graphic.

This is the shape of the result, abbreviated and illustrative. Text is a native command; the barcode travels as a graphic field cut from the bitmap.

label.zplZPL
; abbreviated
^XA
^CI28
^PW812^LL1218
^FO32,40^A0N,36,36
^FDLogística Andina S.A.^FS
^FO32,240
^GFA,5984,5984,44,
  :Z64:eJz…:
^FS
^XZ

Illustrative and abbreviated. What is ZPL? explains each command.

The release gate. In every reference case, each graphic embedded in ZPL or EPL output must be pixel-identical to the engine's 1bpp output. A change that breaks it is not released.

How native and raster printing work Native or raster, worked out Printer languages: ZPL and EPL ZPL reference

Reaching the printer: direct, or through the agent

Runs in your application, or your API server and a print agent on the printer's network

There are two routes, and the printer commands are the same on both.

The two routes from the printer commands to the printer
RouteHow it worksGood to know
A. Direct, from your application The SDK packages send the commands from your own .NET process over TCP port 9100, serial, the Windows spooler, CUPS or Linux USB. No API server and no agent is in the path. Over TCP, serial and USB the printer can answer status queries on the same connection.
B. Through your API server Your application queues a print job through the REST API on your API server. A print agent on the printer's network holds a connection open to that server, collects the job and writes it to the printer beside it, on Windows or Linux. The agent only dials out, with HTTPS and one WebSocket. It opens no listening port and works through proxies.

The agent is paired, not given a password. An administrator creates a one-time pairing code that expires after ten minutes. The agent enrolls with your API server using it, creates its own key pair on the machine and sends only the public half. The server signs every job, and the agent checks the signature before anything reaches a printer.

Two limits are deliberate. The API server never connects to a printer itself: only the agent, which sits next to the printers, writes to them. And the browser never calls a port on your machine. Color and non-thermal printers print through graphic mode instead: raster pages to Windows agents and PDF to Linux agents, drawn through GDI or CUPS from the same layout.

Transports and status The print agent Pairing, connection and jobs Agent security

Status and the life of a job

Runs in the printer and your application, or the agent and your API server

Over a two-way transport (TCP, serial or USB) the engine reads the printer's own status: paper out, pause, head open, ribbon out, over or under temperature, buffer full and labels remaining, plus RFID results. The Windows spooler and CUPS report queue and job state only, and the API says so.

A job queued on your API server moves through states you can see:

  1. Queued
  2. Dispatched
  3. Received
  4. Spooled
  5. Printed
  • Failed
  • Canceled
  • Expired

A job for an agent that is offline waits in the queue until its expiry, which can be set per tenant. If the agent is lost before it acknowledges, the job goes back to Queued. Delivery to the agent is at-least-once and the agent de-duplicates by job id, so a reconnect does not print a label twice. Print jobs also honor an idempotency key, so a retried request does not queue a second label.

In the API, POST /print-jobs queues a job, GET /print-jobs/{id} follows it, POST /print-jobs/{id}/cancel cancels it and GET /printers/{id}/status reads a printer.

API endpoints Retries and errors

Three ways to use it

The SDK packages, the REST API and the label editor all run one engine, so the path above is the same whichever one a label goes through.

  • SDK packages. The engine inside your own application, with no server and no agent. Packages
  • REST API. The same engine behind an API on a server you run, with Microsoft SQL Server as its data store, for any language or stack. Everything the editor does, it does through this API. REST API
  • Label editor. A designer you embed in your own web application. It draws every element with the engine, so the canvas is the print, and sends print jobs to your API server for the agent to deliver. Label editor

What stays the same

  • Preview equals print. The canvas, the bitmap and the printer commands all read one layout.
  • No silent substitutions. Where a printer can draw something neither natively nor as raster, the job is rejected with a diagnostic instead of printing something different.
  • Same bytes everywhere. The same input gives the same output on every supported platform.
  • No inbound ports. The agent dials out, so the printer network needs no inbound port.
  • Your data stays yours. Templates, data and print jobs stay on infrastructure you operate.
  • Printing carries on. A license problem never stops your printing: the worst case is marked output, with every element and barcode still on the label.

New to the printer language? Read the ZPL guides and command reference.

Sources Everything this page says about BarcoderX comes from its published platform, printing, API, developers, editor, barcodes, pricing and FAQ pages.

Written by BarcoderX in its own words.

Zebra, ZPL and ZPL II are trademarks of Zebra Technologies Corporation. BarcoderX is an independent product and is not affiliated with, endorsed by or sponsored by Zebra Technologies.