zpl.tools
Print control

^MC - Map Clear

Keeps the previous label's image as the background of the next one, instead of starting from a blank page.

A printer clears its internal bitmap after each format prints, so every label starts blank. ^MCN stops the clear, and the printer composites the next label on top of the one before it. Placement decides which image survives: the command belongs in the label whose image the printer must keep, not in the label that receives the background.

Syntax

^MCa

Support

Supportedparsed: full · state: full · rendered: full

Every documented parameter renders the same output Labelary produces.

The parser reads the flag and the renderer applies it. ^MCN carries the finished label's content into the next label, ^FV fields excepted, so a format can draw its fixed frame once and resupply only the variable data. Map clear is a printer setting, so one ^MCN goes on carrying content over label after label. The setting in force at a label's own ^XZ decides whether that label carries over. An omitted or a rejected value keeps the setting already in force. A ~JA or ~JX canceled format prints no page of its own. The ink it had already laid down still carries over, while what it drew after the cancel is lost. Carried-over content is part of the page it lands on: ^POI turns it with the rest of that label, and the consuming label's ^LH moves only its own fields. Measured against Labelary on 2026-08-20. — not pinned by a test

Labelary renders this command.

Parameters

aClear the bitmapoptional · Y or N

Whether the printer clears the internal bitmap between labels. With N, it composites the next label on top of the previous one.

Default
Y
Invalid value
discarded, and the current value is kept. A value that is neither Y nor N is reported and leaves the setting already in force in place, and so does an omitted one (measured 2026-08-20). A value of more than one character is trimmed to its first.
Test coverage
No documented value is exercised by a test (Y, N). The invalid-value rule is pinned by 2 tests.
Y
Start each label from blank (default)
N
Keep the previous label as a background

Behavior

^MCN is not a single-label switch. The guide states that retention covers the current label and every label after it until ^MCY clears it. A format that never sends ^MCY stacks every later label onto one accumulating image.

With ^MCN in the first of two formats, Labelary's second page carries both labels' content (measured 2026-07-30). Moving the ^MCN into the second format returns two ordinary pages, because Labelary cleared the first label's bitmap before that command arrived.

The guide adds one requirement for the usual application. A label template prints the fixed artwork once and overlays only the variable data, so ^MC must appear together with ^FV.

The parser reads the argument and discards it, so ^MCN behaves like ^MCY and the renderer draws each label on a blank page. The renderer reports nothing, because it recognizes the command. A format that needs the previous label underneath must instead compose the shared artwork into every label.

Known issues

Tested behavior

Differences from the specification

zpl.tools against the ZPL II guide

Where our renderer behaves differently from the specification.

  • The printer retains a bitmap; the renderer keeps the finished label's drawing commands and seeds the next page with them. The two agree pixel for pixel on everything measured, because ink only ever accumulates, and the replay is what lets both the PDF and the PNG backend carry a label over: a vector backend has no previous raster to composite. — pinned by test_mc_carried_content_is_not_reversed_by_a_later_label_reverse, test_mc_carried_content_keeps_its_rotation_when_fw_changes, test_mc_map_clear_n_carries_the_label_over

Example

^MCN in the first format, so the second page carries both labels:

^XA
^MCN
^FO50,50^A0N,40,40^FDFirst label^FS
^XZ
^XA
^FO50,120^A0N,40,40^FDSecond label^FS
^XZ

Open in viewer