^XA - Start Format
Begins a label format.
^XA opens a label format. Everything between it and the matching ^XZ describes
one label, and a printer does not act on a field until the pair closes. ^XA does
not give a clean slate: it opens a format, and it does not reset the printer.
Anything a previous format set — the current font, the bar code defaults, the caret
and tilde characters — stays in force.
Syntax
^XAAlternate form: 0x02.
Support
Every documented parameter renders the same output Labelary produces.
Labelary renders this command.
Parameters
^XA takes no arguments.
Behavior
The parser still reads commands outside an ^XA…^XZ pair. That is the point of the
control commands: ~CC, ~CD, ~JA and their kind belong between formats. Format
commands such as ^FO and ^FD need the brackets, because they describe a label that
must exist first.
Format-level state carries over from one label to the next, and readers most often
assume it away. In this renderer and on Labelary alike, ^CFA,60 in one format still
sizes the text of the following format, and ^BY5 still widens the following format's
bar codes (measured 2026-07-30). The prefix and delimiter changes from ^CC, ^CT and
^CD persist the same way. In a stream of labels, set every dependency inside each
pair rather than trust the state the previous label left.
An empty format, ^XA^XZ, renders no page at all rather than a blank one. Both
renderers agree on that, so a label whose entire layout came from an unimplemented
command can come back as zero pages rather than as a blank sheet.
Tested behavior
Differences from the specification
zpl.tools against the ZPL II guide
Where our renderer behaves differently from the specification.
- The guide does not state what a second
^XAbefore the matching^XZdoes. The renderer restarts the label and discards everything drawn so far, as a printer does with a truncated format. We measured this on 2026-07-30; Labelary behaves the same way. — pinned bytest_xa_overrides_printable_input
Example
A minimal format: one text field and a rule beneath it.
^XA
^FO50,50^A0N,40,40^FDHello World^FS
^FO50,110^GB300,3,3^FS
^XZ
Related commands
^XZEnd FormatEnds a label format and prints it.^FSField SeparatorEnds the current field.^DFDownload FormatStores the rest of the label as a reusable format instead of printing it.