Printing guide

Native or raster printing

A printer can be sent commands that describe a label, or an image of it. This page shows what each one costs and gains, with the sizes worked out, and how BarcoderX chooses between them for every element.

What is built today: Status

The difference is who decides the dots

A thermal print head prints dots, and every label ends up as dots: ink or paper, nothing in between (1bpp). The only question is who works out which dots. With native printing you send a command such as "a box 360 dots wide and 160 high", and the printer's own firmware decides the dots. With raster the engine works the dots out itself and sends them as a graphic.

Schematic of the same box sent as a native command and as raster dots One box on the label, 360 by 160 dots, can reach the printer in two ways. On the native lane it travels as a short command, 23 characters long, and the printer decides each dot in its own firmware. On the raster lane it travels as a grid of dots, 45 bytes per row for 160 rows, and the engine has already decided each dot. Both lanes end at the printer, which prints the dots. One box on the label 360 by 160 dots NATIVE RASTER A command ^FO30,30 ^GB360,160,4 ^FS 23 characters Dots 45 bytes per row, 160 rows The printer decides each dot, in its firmware The engine decides each dot, before sending Printer prints the dots
Schematic. The grid has far fewer dots than a real label, to show the idea. The command is the box example from our ZPL guide to boxes and lines.

Native

You send a command that describes the element, such as a ZPL text or barcode command, and the printer draws it. It is compact, and it is only correct if the printer draws it the way the preview shows.

Glossary: native printing

Raster

The engine draws the dots at the printer's resolution and sends them as a graphic. The print matches the preview, at the cost of more data.

Glossary: raster

What each one costs and gains

Neither way is better everywhere. Native is small and leaves the drawing to the printer. Raster is bigger and leaves nothing to the printer. This table sets them side by side, row by row.

Native and raster compared: what is sent, size, fonts, barcodes, exactness, resolution, speed and what happens when the printer cannot do it
AspectNativeRaster
What is sent A command that describes the element: where it goes, how big it is and what it says. The element's dots, one bit each, row by row. In ZPL a graphic field carries them.
Size on the wire Small. It grows with the content, so a longer text is a longer command, and not with the area the element covers. Grows with the area the element covers, counted in dots. The next section works out an example.
Who decides the dots The printer's firmware. The engine, at the printer's resolution.
Text The printer's own fonts draw the glyphs, so their shapes depend on the printer. In BarcoderX, text in a printer-resident font is the "native, approximate" outcome: the preview shows a substitute and the editor flags the element with a badge. The engine draws the glyphs, so the print shows what the preview shows. Text the printer cannot draw natively goes out as raster; only when neither works is the job rejected. In EPL, text outside the selected code page is always raster.
Barcodes The printer's own barcode command. It is compact, and the printer lays out the bars, so the result depends on its firmware. BarcoderX uses it only where the printer's profile marks it equal to the preview and, for barcodes, a lab scan agrees. The engine places every bar on whole dots at the printer's resolution, exactly as in the preview, and sends the result.
Match with the preview Equal only where the profile says so. Text in a resident font is the flagged exception. Identical. In every reference case, each graphic embedded in ZPL or EPL output must be pixel-identical to the engine's 1bpp output, and a change that breaks that is not released.
Resolution Positions and sizes are counted in dots, so a command is made for one density. The bitmap is made for one density too: on another density it prints at another physical size. BarcoderX draws the dots at the resolution recorded in the printer's profile.
Speed Less to send and less for the printer to receive. How much time that saves depends on your link and your printer. More to send and to receive, in proportion to the sizes below. The same caveat applies.
When the printer cannot do it If the printer has no matching command or barcode, the element cannot go out natively. Any printer that prints dots can print it. Only when neither way works does BarcoderX reject the job with a diagnostic, instead of printing something different.

BarcoderX has published no throughput figures, and this page does not invent any. Measure with your own printers, label designs and network before you promise a rate to anyone.

How big a raster is, worked out

Size is where the two differ most, and it is plain arithmetic. A ZPL graphic field needs the bytes per row and the number of rows. Bytes per row is the image width in dots divided by 8, rounded up to a whole byte. In its ASCII hexadecimal form, every image byte is written as two hexadecimal digits. The ZPL images guide works through the same formula.

One box, as a command
The box from the figure, ^FO30,30^GB360,160,4^FS, is 23 characters. It describes a box 360 dots wide and 160 high with a 4-dot border in a few numbers, so its length does not grow with the area the box covers.
The same box, as a graphic
360 dots is 45 bytes per row, and the box is 160 rows high.45 × 160 = 7,200 bytes, or 14,400 hexadecimal digitsA graphic covers the whole rectangle, empty dots included, so a hollow box costs as much as a solid one.
A whole label, as one graphic
A 4 by 6 inch label at 203 dpi is 812 by 1,218 dots. 812 dots is 101.5 bytes, so each row takes 102.102 × 1,218 = 124,236 bytes, or 248,472 hexadecimal digitsThat is the figure for sending the entire label as one picture.
What compression changes
ZPL also accepts compressed graphic data, and in ASCII data a comma fills the rest of a row with zeros. Both shrink a graphic. The figures above are the uncompressed sizes.

That does not make native always the right answer. A barcode or a line of text as a command is tiny. An image has no drawing command at all: in ZPL it reaches the printer as dots, by one of three documented routes.

ZPL graphic field (^GF) ZPL box (^GB) Glossary: dots

How BarcoderX chooses

The engine does not pick one way for the whole label. For each element it asks the printer's profile how that element can be drawn, then lands on one of four outcomes.

Native
The 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, approximate
Text in a printer-resident font. The preview shows a substitute, and the editor flags the element with a badge.
Raster
The 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.
Unsupported
Neither is possible. The job is rejected with a diagnostic, instead of printing something different.

What the profile knows

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. Model-specific profiles come from lab measurements, and tenants can derive custom profiles from a built-in one.

Two intents, and a hint on each element

Fidelity
The default. The print looks like the preview, and native commands are used only where they are proven equal.
Native preferred
Favors printer-side commands where they exist.
Output hint
An output hint on each element can ask for Auto, Native or Graphic.

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.

No silent substitutionsWhere a printer can draw an element neither natively nor as raster, the job is rejected with a diagnostic instead of printing something different.

How it works: printer commands Printing: native or raster The print agent: how a job reaches the printer

ZPL and EPL

How much of a label can go out natively depends on the printer language. ZPL has native commands for text, barcodes, shapes and graphics, plus RFID encoding, so more of a ZPL label goes out as native commands. EPL has native lines, boxes and barcodes, and the rest is rasterized, so an EPL label is mostly raster graphics with native barcodes and shapes.

Printer languages: ZPL and EPL Printing: languages and exports

Big jobs, and printers that only print pages

Big jobs stay light
When a job has many labels, static content is stored on the printer once and recalled for each label, then deleted at the end of the job by default.
Color and non-thermal printers
They print through graphic mode: raster pages to Windows agents and PDF to Linux agents, drawn through GDI or CUPS from the same layout.

Choosing as a developer

  • Start with fidelity. It is the default: the print looks like the preview, and native commands are used only where they are proven equal.
  • Use the output hint for one element, not the whole label. It asks for Auto, Native or Graphic on that element alone.
  • Read the diagnostic. A rejected job comes back with a diagnostic, and nothing prints something different in its place.
  • Measure on your printers. Sizes follow from the arithmetic above, but time depends on your link and your printer.

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

Sources What this page says about BarcoderX comes from its published printing, how-it-works and glossary pages. The byte arithmetic uses the formula in our ZPL images guide, which restates Zebra's programming guide, and the dot counts in our glossary.

Written by BarcoderX in its own words.

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.