zplCore.comzplCore.com

ZplCore #

30 types

Core rendering engine (ZplRenderer, EplRenderer, ZplRenderSettings, ZplResourceStore, ZplExport, ZplOptimizer, ZplCutPlan, ZplLimits, diagnostics).

EplRenderer Virtual EPL2 printer. EPL commands are translated to equivalent ZPL and rendered by ZplRenderer, so EPL labels get the same fon… class11 members#
public sealed class EplRenderer

Virtual EPL2 printer. EPL commands are translated to equivalent ZPL and rendered by ZplRenderer, so EPL labels get the same fonts, barcodes and outputs. EplRenderer.ToZpl exposes the translation (EPL → ZPL converter).

Not thread-safe (stored forms/graphics, wrapped ZplRenderer); use one instance per thread.

Constructors

SignatureDescription
# EplRenderer(ZplRenderSettings? settings = default)

Properties

PropertyTypeDescription
Clock { get; set; }Func<DateTime>Time used for TT/TD fields.
Settings { get; }ZplRenderSettings
Store { get; }ZplResourceStorePrinter memory shared with the underlying ZPL renderer.

Methods

Method SignatureReturnsDescription
# AddGraphic(string name, byte[] pcx)voidStores a PCX graphic for GG (like GM).
# ProcessCommands(string epl)List<byte[]>
# ProcessCommands(byte[] epl)List<byte[]>Raw EPL bytes (default code page 850, binary graphic data kept intact).
# ProcessFile(string path)List<byte[]>
# Render(string epl)List<ZplRenderResult>Renders to bitmaps (caller disposes).
# ToZpl(string epl)stringTranslates EPL2 to ZPL II (one ^XA…^XZ per printed label).

Events

EventHandler TypeDescription
PrinterControlEventHandler<ZplPrinterControlEventArgs>Raised for EPL commands that don't affect the image (S, D, I, O, U, JF ...), as ZPL-style commands.
ScanProofOptions Settings for ZplScanProof. class14 members#
public sealed class ScanProofOptions

Settings for ZplScanProof.

Constructors

SignatureDescription
# ScanProofOptions()

Properties

PropertyTypeDescription
AntiAlias { get; set; }boolRender with anti-aliasing. Off by default: a thermal printer prints whole dots, so the 1-bit render is what gets printed. Turn it on to see the effect of grey edges (finding SP1106).
ConfigureRender { get; set; }Action<ZplRenderSettings>Adjusts the render settings before rendering (fonts, ^PW/^LL forcing …). Scan-proof's own settings are applied after it.
Dpi { get; set; }intPrinter resolution the label is rendered and measured at (152, 203, 300 or 600 dpi). Default 203.
FieldValues { get; set; }IReadOnlyDictionary<int, string>Values for ^FN fields (as ZplRenderSettings.FieldValues).
LabelHeight { get; set; }int?Label height in dots when the ZPL has no ^LL (default 6 in at ScanProofOptions.Dpi).
LabelWidth { get; set; }int?Label width in dots when the ZPL has no ^PW (default 4 in at ScanProofOptions.Dpi).
MaxLabels { get; set; }intMaximum number of labels checked (^PQ copies and formats); identical copies are skipped. Default 50.
MaxXDimensionMm { get; set; }double?
MinXDimensionMm { get; set; }double?Smallest/largest allowed X-dimension in mm (e.g. an application specification such as a carrier or GS1 logistics table). Overrides the symbology's own range (EAN/UPC: 0.264–0.660 mm); null keeps it.
Robustness { get; set; }boolAlso run the robustness simulation: decode after deterministic degradations (bar gain/loss in whole dots, blur, ±2° rotation, lower resolution). A heuristic stress test, not a model of a particular printer.
RobustnessTargetDpi { get; set; }intResolution of the downscale step of the robustness simulation (default 203; skipped when not below ScanProofOptions.Dpi).
UseZxingCpp { get; set; }boolUse zxing-cpp (native) when it is available on this platform. Default true.
UseZxingNet { get; set; }boolUse ZXing.Net (managed). Default true.
ZplCaches Process-wide caches of the rendering engine (glyph masks, per-typeface metrics, HarfBuzz shapers, compiled property getters). A… class3 members#
public static class ZplCaches

Process-wide caches of the rendering engine (glyph masks, per-typeface metrics, HarfBuzz shapers, compiled property getters). All caches are thread-safe and bounded; ZplCaches.Clear releases them, e.g. after many downloaded (~DU/~DY) fonts were used and dropped.

Properties

PropertyTypeDescription
static GlyphCount { get; }intNumber of glyphs currently cached (approximate).
static MaxGlyphs { get; set; }intMaximum number of rasterised glyphs kept (default 20000, roughly 20–60 MB depending on font sizes). When exceeded the glyph cache is emptied and rebuilt on demand. 0 = unlimited. Lowering the limit below the current ZplCaches.GlyphCount empties the cache at once (not only when the next glyph is added).

Methods

Method SignatureReturnsDescription
static # Clear()voidEmpties all engine caches. Safe to call while other threads render.
ZplCutDiagnosticCodes Stable codes of ZplCutPlan.Diagnostics (see DIAGNOSTICS.md). class5 members#
public static class ZplCutDiagnosticCodes

Stable codes of ZplCutPlan.Diagnostics (see DIAGNOSTICS.md).

Fields & Constants

FieldTypeDescription
const AwaitingDelayedCut = "ZPL4102"string^MMD: labels wait for ~JK at the end of the job.
const CutNowIgnored = "ZPL4104"string^CN outside kiosk mode has no effect.
const CutSuppressed = "ZPL4105"string^XB in cutter mode suppresses the cut.
const DelayedCutIgnored = "ZPL4103"string~JK without effect (not in delayed cut mode, no label waiting, or sent in the same job as the label).
const NoCutter = "ZPL4101"stringCutter, delayed cut or kiosk mode on a printer without cutter: no label is cut (a printer reports a cutter fault).
ZplCutPlan Where a Zebra printer with cutter cuts the labels of one render call (ZplRenderer.LastCutPlan): one ZplLabelCut per printed lab… class8 members#
public sealed class ZplCutPlan

Where a Zebra printer with cutter cuts the labels of one render call (ZplRenderer.LastCutPlan): one ZplLabelCut per printed label plus diagnostics. Rules (ZPL II Programming Guide ^MM, ^PQ, ^XB, ^CN, ^KV, ^JU, ~JK) are described in docs-internal/chaos-printer.md.

Properties

PropertyTypeDescription
CutAfter { get; }IReadOnlyList<int>Indexes of the labels after which the printer cuts.
CutCount { get; }intNumber of cuts.
CutsPreviousJob { get; }boolA ~JK in this job cut the label that the previous job (an earlier render call) left waiting in ^MMD.
Diagnostics { get; }IReadOnlyList<ZplDiagnostic>Hints such as ^MMD without ~JK or cutter mode without cutter (codes in ZplCutDiagnosticCodes).
static Empty { get; }ZplCutPlanAn empty plan (no labels).
Labels { get; }IReadOnlyList<ZplLabelCut>One entry per printed label, in print order.

Methods

Method SignatureReturnsDescription
static # Analyze(string zpl, ZplRenderSettings? settings = default)ZplCutPlanRenders zpl with a fresh renderer and returns its cut plan (the bitmaps are discarded). Pass the settings of the target printer (dpi, label size, ZplRenderSettings.CutterInstalled, ZplRenderSettings.MaxQuantity).
# ToJson(bool indented = false)stringThe plan as JSON: {"labels":[{"index":0,"copy":0,"mode":"Cutter","cut":true,"reason":"EveryLabel", "pauseAfter":false,"partialCutMm":0}],"cutAfter":[0],"cutsPreviousJob":false,"diagnostics":[{"code","severity","message","command"}]}.
ZplCutReason Why a label is (or is not) cut, see ZplLabelCut. enum12 members#
public enum ZplCutReason

Why a label is (or is not) cut, see ZplLabelCut.

Values

NameValueDescription
NoCutMode0The print mode has no cut (tear-off, peel-off, rewind, applicator, RFID, linerless).
EveryLabel1^MMC with ^PQ p = 0: every label is cut.
PauseAndCutCount2^MMC with ^PQ p > 0: cut after each group of p labels ("pause and cut value").
EndOfBatch3^MMC with ^PQ p > 0: the last label of the batch (q not a multiple of p) is cut too.
InsideGroup4^MMC with ^PQ p > 0: label inside a group, the media is not cut here.
SuppressedByXB5^XB in cutter / delayed cut mode: "^XB suppresses backfeed and cutting".
AwaitingDelayedCut6^MMD: the label waits for ~JK (sent in a separate job).
DelayedCut7^MMD: cut by ~JK.
KioskPresented8^MMK: the label is presented and not cut (no ^CN in the format).
KioskCutNow9^MMK with ^CN: cut now (full cut, or partial cut by the ^KV kiosk cut amount).
NoCutterInstalled10Cutter mode, but the printer has no cutter (ZplRenderSettings.CutterInstalled false).
RfidVoid11Voided RFID label cut because of ^PQ e = Y ("cut on error label", virtual printer only).
ZplDiagnostic Structured message about one command or field of a rendered label. ZplDiagnostic.Code is stable across versions (see DIAGNOSTIC… record9 members#
public record ZplDiagnostic

Structured message about one command or field of a rendered label. ZplDiagnostic.Code is stable across versions (see DIAGNOSTICS.md); ZplDiagnostic.Message is human-readable and may change.

Constructors

SignatureDescription
# ZplDiagnostic(string Code, ZplDiagnosticSeverity Severity, string Message, string Command, int Offset = -1, int Line = 0, int Column = 0)Structured message about one command or field of a rendered label. ZplDiagnostic.Code is stable across versions (see DIAGNOSTICS.md); ZplDiagnostic.Message is human-readable and may change. Code: Stable identifier such as "ZPL1001". · Severity: How serious the problem is. · Message: Human-readable description (identical to the matching entry of ZplRenderResult.Warnings). · Command: Command the message refers to, e.g. "^GF" (empty when unknown). · Offset: Character offset of that command in the ZPL source (-1 when unknown). · Line: 1-based source line (0 when unknown). · Column: 1-based source column (0 when unknown).

Properties

PropertyTypeDescription
Code { get; init; }stringStable identifier such as "ZPL1001".
Column { get; init; }int1-based source column (0 when unknown).
Command { get; init; }stringCommand the message refers to, e.g. "^GF" (empty when unknown).
Line { get; init; }int1-based source line (0 when unknown).
Message { get; init; }stringHuman-readable description (identical to the matching entry of ZplRenderResult.Warnings).
Offset { get; init; }intCharacter offset of that command in the ZPL source (-1 when unknown).
Severity { get; init; }ZplDiagnosticSeverityHow serious the problem is.

Methods

Method SignatureReturnsDescription
# Deconstruct(out string Code, out ZplDiagnosticSeverity Severity, out string Message, out string Command, out int Offset, out int Line, out int Column)void
ZplDiagnosticCodes Stable diagnostic codes (documented in DIAGNOSTICS.md). class9 members#
public static class ZplDiagnosticCodes

Stable diagnostic codes (documented in DIAGNOSTICS.md).

Fields & Constants

FieldTypeDescription
const BarcodeDataTooLong = "ZPL1003"stringBarcode field data longer than any symbology can hold; the field was skipped.
const CommandIgnored = "ZPL2001"stringCommand accepted but without effect on the rendered image (^FE, ^FA, RFID read operations ...).
const FieldFailed = "ZPL1002"stringA field could not be drawn (invalid barcode data etc.); it was skipped.
const FontNotFound = "ZPL1201"string^A@/^CW font not found (not downloaded, registered or supplied by the font provider); font A is used.
const GraphicInvalid = "ZPL1102"string^GF graphic data could not be decoded.
const GraphicNotFound = "ZPL1103"string^XG/^IM refers to a graphic that is not stored.
const GraphicTooLarge = "ZPL1101"string^GF graphic too large for the label or the configured limit.
const InvalidFieldValueKey = "ZPL1301"stringA key of ZplRenderSettings.FieldValues matches no ^FN field of the rendered labels (INVALID_FIELD_VALUE_KEY); the value was not used.
const MalformedCommand = "ZPL1001"stringA command could not be executed (malformed parameters); it was ignored.
ZplDiagnosticSeverity Severity of a ZplDiagnostic. enum3 members#
public enum ZplDiagnosticSeverity

Severity of a ZplDiagnostic.

Values

NameValueDescription
Info0Informational: the command is accepted but has no effect on the image (e.g. ^FE, ^FA).
Warning1Part of the label could not be rendered as written (field skipped, fallback used).
Error2The command is malformed and was ignored.
ZplExport Image/PDF/GRF encoders. class5 members#
public static class ZplExport

Image/PDF/GRF encoders.

Methods

Method SignatureReturnsDescription
static # Encode(SKBitmap bitmap, ZplOutputFormat format, int quality = 95, int dpi = 203)byte[]
static # ToBmp(SKBitmap bmp)byte[]24-bit BMP (Skia has no BMP encoder).
static # ToGrfZpl(SKBitmap bitmap, bool compress = true)stringThe label as a single ^GFA graphic inside ^XA…^XZ.
static # ToPdf(IEnumerable<SKBitmap> bitmaps, ZplRenderSettings s)byte[]PDF with metadata from the settings; either one page per label (label size) or, with ZplRenderSettings.PaperWidth/ZplRenderSettings.PaperHeight, labels laid out on sheets.
static # ToPdf(IEnumerable<SKBitmap> bitmaps, int dpi)byte[]One PDF page per bitmap, sized to the physical label.
ZplFlip Mirroring of the output image. enum4 members#
public enum ZplFlip

Mirroring of the output image.

Values

NameValueDescription
None0
X1Mirror left/right.
Y2Mirror top/bottom.
XY3Both (equals a 180° rotation).
ZplLabelCut Cut decision for one printed label (index in print order, ^PQ copies included). record9 members#
public record ZplLabelCut

Cut decision for one printed label (index in print order, ^PQ copies included).

Constructors

SignatureDescription
# ZplLabelCut(int Index, int Copy, ZplPrintMode Mode, bool Cut, ZplCutReason Reason, bool PauseAfter = false, int PartialCutMm = 0)Cut decision for one printed label (index in print order, ^PQ copies included). Index: 0-based label index in the output of the render call. · Copy: 0-based copy within the format's ^PQ quantity. · Mode: Print mode in effect for the label. · Cut: The printer cuts after this label. · Reason: Why it is cut or not. · PauseAfter: ^PQ p with o = N: the printer pauses after this label (end of a group). · PartialCutMm: Kiosk partial cut: millimetres left uncut (^KV a = 10–60); 0 = full cut.

Properties

PropertyTypeDescription
Copy { get; init; }int0-based copy within the format's ^PQ quantity.
Cut { get; init; }boolThe printer cuts after this label.
Index { get; init; }int0-based label index in the output of the render call.
Mode { get; init; }ZplPrintModePrint mode in effect for the label.
PartialCutMm { get; init; }intKiosk partial cut: millimetres left uncut (^KV a = 10–60); 0 = full cut.
PauseAfter { get; init; }bool^PQ p with o = N: the printer pauses after this label (end of a group).
Reason { get; init; }ZplCutReasonWhy it is cut or not.

Methods

Method SignatureReturnsDescription
# Deconstruct(out int Index, out int Copy, out ZplPrintMode Mode, out bool Cut, out ZplCutReason Reason, out bool PauseAfter, out int PartialCutMm)void
ZplLabelRenderedEventArgs class4 members#
public sealed class ZplLabelRenderedEventArgs : EventArgs

Constructors

SignatureDescription
# ZplLabelRenderedEventArgs(int index, byte[] data, IReadOnlyList<ZplRenderedElement> elements)

Properties

PropertyTypeDescription
Data { get; }byte[]
Elements { get; }IReadOnlyList<ZplRenderedElement>
Index { get; }int
ZplLimits Hard engine limits for untrusted input that apply to every renderer created or used inside a scope opened with ZplLimits.Enforc… record12 members#
public record ZplLimits

Hard engine limits for untrusted input that apply to every renderer created or used inside a scope opened with ZplLimits.Enforce, including the renderers that higher-level features create internally (compliance check, scan-proof, label import, extraction/redaction, GS1 migration, printer twin, cut plan, Vector-Lift). Settings and printer stores are clamped to the stricter of their own value and the limit, so a feature cannot loosen them.

The scope flows with the async/execution context (AsyncLocal), so it covers tasks and Parallel loops started inside it. Scopes nest: the effective limits are the strictest of all open scopes. Without a scope nothing changes. Used by the MCP server's worker for every tool call.

Constructors

SignatureDescription
# ZplLimits()

Properties

PropertyTypeDescription
static Current { get; }ZplLimitsThe limits in force on this execution context, or null when no scope is open.
FixedClock { get; init; }DateTime?Clock for ^FC fields and timestamps instead of the host clock (null: keep the renderer's clock).
Isolated { get; init; }boolTrue: no ZplRenderSettings.FontProvider, no system fonts (ZplRenderSettings.UseSystemFonts), no background/watermark image and no decoded-graphic cache. Fonts can then only be downloaded in the same input.
MaxFieldDataLength { get; init; }intLongest field data (ZplRenderSettings.MaxFieldDataLength).
MaxGraphicBytes { get; init; }intLargest decoded graphic (ZplRenderSettings.MaxGraphicBytes).
MaxLabelDots { get; init; }longDots per label (ZplRenderSettings.MaxLabelDots).
MaxLabelSide { get; init; }intLongest label side (ZplRenderSettings.MaxLabelSide).
MaxLabels { get; init; }intLabels per render call (ZplRenderSettings.MaxLabels).
MaxQuantity { get; init; }int^PQ copies (ZplRenderSettings.MaxQuantity).
MaxStoreBytes { get; init; }longPrinter storage per store (ZplResourceStore.MaxTotalBytes; 0 there means unlimited and is clamped too).

Methods

Method SignatureReturnsDescription
static # Enforce(ZplLimits limits)IDisposableOpens a scope; dispose it to restore the previous limits. Nested scopes combine to the strictest values.
ZplOptimization Level of ZplOptimizer. enum3 members#
public enum ZplOptimization

Level of ZplOptimizer.

Values

NameValueDescription
None0ZPL is left as generated.
Safe1Removes state commands (^BY, ^CF, ^FW, ^CI) that repeat the value already in effect within the same format. Line breaks and all other commands stay untouched.
Aggressive2ZplOptimization.Safe plus: line breaks between commands removed (so ^FO, ^A, ^FB … of a field form one run), default trailing ^GB parameters stripped (",B,0"), and ^GFA data re-encoded in the requested GraphicCompression (default: whichever is shortest).
ZplOptimizer Shrinks ZPL without changing what gets printed. Field data (^FD/^FV … ^FS) is never modified, state tracking is reset at ^XA, ^… class1 member#
public static class ZplOptimizer

Shrinks ZPL without changing what gets printed. Field data (^FD/^FV … ^FS) is never modified, state tracking is reset at ^XA, ^DF, ^XF and ^MU, and input that changes the command prefixes (^CC/^CD/^CT) is returned unchanged.

Methods

Method SignatureReturnsDescription
static # Optimize(string zpl, ZplOptimization level, GraphicCompression? graphicCompression = default)stringOptimises zpl at level. zpl: ZPL source. · level: Optimisation level. · graphicCompression: Aggressive only: encoding for ^GFA data (null = shortest of all).
ZplOutputFormat enum16 members#
public enum ZplOutputFormat

Values

NameValueDescription
Png0
Jpeg1
Webp2
Bmp3
Pdf4
Grf5ZPL with the rendered label as one ^GFA graphic (e.g. for printers lacking fonts).
Tiff6Multi-page 1-bit TIFF (all labels in one file).
Pcx71-bit PCX per label.
Pcl8PCL 5 raster per label (laser printers).
Epl9EPL2 with the label as GW graphic (Eltron/Zebra EPL printers).
Fingerprint10Intermec Fingerprint/DirectProtocol raster.
EscPos11ESC/POS raster (receipt printers), incl. cut.
Gif12GIF per label.
Svg13SVG per label: true vector output by default (see ZplRenderSettings.SvgMode).
Html14One HTML page with all labels (see ZplRenderSettings.HtmlImageFormat).
Eps15Encapsulated PostScript per label (see ZplRenderSettings.EpsTextAsOutlines).
ZplPaperOrientation Orientation of output pages. enum2 members#
public enum ZplPaperOrientation

Orientation of output pages.

Values

NameValueDescription
Portrait0Labels as designed.
Landscape1Portrait labels (taller than wide) are turned 90° clockwise; PDF sheets are used landscape.
ZplPrintMode Print mode set with ^MMa (ZPL II Programming Guide, ^MM). The value is the ^MM letter. The mode persists across formats until i… enum10 members#
public enum ZplPrintMode

Print mode set with ^MMa (ZPL II Programming Guide, ^MM). The value is the ^MM letter. The mode persists across formats until it is changed, ^JUS saves it as the power-on value (see docs-internal/chaos-printer.md).

Values

NameValueDescription
TearOff84^MMT tear-off (factory default).
PeelOff80^MMP peel-off.
Rewind82^MMR rewind.
Applicator65^MMA applicator.
Cutter67^MMC cutter: "after printing, the media feeds forward and is automatically cut".
DelayedCut68^MMD delayed cutter: the waiting label is cut when the printer receives ~JK.
Rfid70^MMF RFID (no backfeed between RFID labels).
LinerlessPeel76^MML (reserved in ^MM; "Linerless Peel" in SGD media.printmode).
LinerlessRewind85^MMU (reserved in ^MM; "Linerless Rewind" in SGD media.printmode).
Kiosk75^MMK kiosk: the media is presented; ^CN cuts it.
ZplPrinterControlEventArgs class3 members#
public sealed class ZplPrinterControlEventArgs : EventArgs

Constructors

SignatureDescription
# ZplPrinterControlEventArgs(ZplCommand command)

Properties

PropertyTypeDescription
Command { get; }ZplCommand
Response { get; set; }stringData to send back to the host (e.g. for ~HS); prefilled for ~HS.
ZplRenderResult One rendered label. class8 members#
public sealed class ZplRenderResult

One rendered label.

Constructors

SignatureDescription
# ZplRenderResult()

Properties

PropertyTypeDescription
required Bitmap { get; init; }SKBitmap
Cut { get; }ZplLabelCutCut decision for this label (set by ZplRenderer; see ZplRenderer.LastCutPlan).
Diagnostics { get; }IReadOnlyList<ZplDiagnostic>Structured messages (stable codes, severity, source position) — see DIAGNOSTICS.md.
Elements { get; init; }IReadOnlyList<ZplRenderedElement>
RfidCommands { get; init; }IReadOnlyList<ZplRfidCommand>RFID commands of this label in format order (empty for labels without RFID); see ZplRfidCommand.
Warnings { get; init; }IReadOnlyList<string>Fields that could not be rendered (invalid data etc.); a printer skips those silently. Derived from the ZplRenderResult.Diagnostics of severity Warning and Error (their messages).

Methods

Method SignatureReturnsDescription
# RenderedElementsAsJson(bool indented = false)stringZplRenderResult.Elements as a JSON array (needs ZplRenderSettings.TraceElements): every element has type (command, e.g. "A", "BC", "GB"), bounds {x, y, width, height} in dots, rotation (0/90/180/270 clockwise from N/R/I/B), reverse, data and sourceOffset/sourceLength into the ZPL.
ZplRenderSettings Settings for rendering ZPL to images. All sizes in printer dots unless noted. class83 members#
public sealed class ZplRenderSettings

Settings for rendering ZPL to images. All sizes in printer dots unless noted.

Constructors

SignatureDescription
# ZplRenderSettings()

Properties

PropertyTypeDescription
AntiAlias { get; set; }boolAnti-aliased text and shapes. Off gives pure 1-bit output like a thermal printer.
BackgroundColor { get; set; }SKColorLabel (paper) color.
BackgroundImage { get; set; }SKBitmapOptional image drawn below the label content (e.g. a pre-printed form).
Clock { get; set; }Func<DateTime>Printer clock for ^FC fields (override for deterministic output). Also the PDF creation/modification date, which is always written in UTC (a DateTimeKind.Unspecified value counts as local time).
CompactPng { get; set; }boolWrite black/white labels as 8-bit grayscale (anti-aliased) or 1-bit PNG (ZplRenderSettings.AntiAlias off) instead of 32-bit RGBA — much faster and smaller. Coloured output always uses RGBA.
CutMarkColor { get; set; }SKColorColour of the cut line and scissors (default red #D32F2F).
CutMarks { get; set; }boolDraws cut markers into preview output (opt-in, default off: output stays byte-identical). Every label gets a light grey strip below its bottom edge (the trailing edge in feed direction); a label after which the printer cuts (ZplRenderer.LastCutPlan) shows a dashed line with a scissors glyph in that strip, a partial kiosk cut leaves a gap in the line, a ^MMD label waiting for ~JK shows the marker in grey, and a ^PQ pause is shown as a pause sign at the right end. Applies to PNG, JPEG, WebP, BMP, GIF, PDF, SVG, HTML and EPS (also ZplRenderer.RenderSvg and the bitmaps of ZplRenderer.Render), never to printer languages or 1-bit TIFF/PCX.
CutterInstalled { get; set; }boolThe printer has a cutter (default true). When false, cutter, delayed cut and kiosk mode cut nothing and the cut plan reports ZplCutReason.NoCutterInstalled (the virtual printer raises a cutter fault).
DecodedWithPrinterCodePages { get; set; }boolThe ZPL string was decoded from printer bytes with ZplTextEncoding (code page of the active ^CI). Barcodes and the other non-text fields then encode those bytes again, like a printer; text fields print the decoded characters. ZplRenderer.ProcessCommands and the virtual printer do this on their own; set it when you decode with ZplTextEncoding yourself.
DefaultCodePage { get; set; }intCode page of field data before the first ^CI (Zebra power-up value ^CI0: code page 850). 1252, 1250, 1251, 1253, 1254 and 1255 select the matching ^CI (27, 31, 33–36) as power-up value, 65001 ^CI28.
DotsPerMm { get; }double
Dpi { get; set; }intPrint resolution: 152, 203, 300 or 600 dpi.
DrawRfid { get; set; }boolDraw the data of ^RF (RFID) fields as a small box on the label.
EpsTextAsOutlines { get; set; }boolEPS output as vector outlines (text, barcodes and graphics traced to filled shapes) instead of an image.
FieldValues { get; set; }IReadOnlyDictionary<int, string>Values for ^FN fields, keyed by field number (^FN1 → key 1). A value replaces the data of every field with that number in every label of the render call: fields of the label itself, fields of formats recalled with ^XF (it wins over the ^XF data block and over a ^FD default). ^FH, ^FC and ^SN/^SF still apply to the value. Keys without a matching ^FN field are reported as diagnostic ZplDiagnosticCodes.InvalidFieldValueKey on the first label. Null or empty = no override (default).
FingerprintDisableRun { get; set; }boolFingerprint output without the trailing print statement (PF), e.g. to merge into own programs.
Flip { get; set; }ZplFlipMirror the final image (applied after rendering, before encoding).
FontProvider { get; set; }Func<string, byte[]>Resolves fonts that a label references but that were never registered or downloaded (e.g. "E:ARIAL.TTF" in ^A@/^CW): return the TTF/OTF bytes, or null if unknown. Called at most once per font name per FontManager. Unresolved ^A@ fonts print with font A, like a Zebra printer.
ForceLabelHeight { get; set; }bool
ForceLabelWidth { get; set; }bool
GrfCompression { get; set; }GraphicCompression^GF data encoding for ZplOutputFormat.Grf output.
GrfDither { get; set; }DitherMode1-bit conversion for ZplOutputFormat.Grf output.
HtmlImageFormat { get; set; }HtmlLabelImageFormatImage embedded in ZplOutputFormat.Html output.
ImageScaleX { get; set; }doubleHorizontal scale factor of encoded images (1 = printer dots). DPI metadata is scaled accordingly.
ImageScaleY { get; set; }doubleVertical scale factor of encoded images.
InkColor { get; set; }SKColorInk / ribbon color.
InvertColors { get; set; }boolSwap ink and background (negative output).
LabelGap { get; set; }int
LabelHeight { get; set; }intLabel height in dots (default 6 in). ^LL overrides unless ZplRenderSettings.ForceLabelHeight.
LabelLengthContinuousOnly { get; set; }boolApply ^LL only on continuous media (^MNN), like a gap/mark-sensing printer and Labelary: with web or mark sensing the printer measures the label length itself and ^LL does not shorten the printed area. Default off (^LL always sets the image height).
LabelWidth { get; set; }intLabel width in dots (default 4 in). ^PW overrides unless ZplRenderSettings.ForceLabelWidth.
MaxFieldDataLength { get; set; }intMaximum length of one field's data (^FD/^FV, after ^FH); longer data is truncated (default 1 M chars). 0 = unlimited.
MaxGraphicBytes { get; set; }intMaximum decoded size of one graphic (^GF, ~DG, ~DY, ~DU, Z64 inflate output) in bytes (default 32 MB). Larger graphics are ignored (^GF records a warning). 0 = unlimited.
MaxLabelDots { get; set; }longMaximum label area in dots (width × height) after ^PW/^LL/settings. Larger labels are clamped (height first, then width) so malicious input cannot allocate gigabytes. Default 64 M dots (e.g. 8000 × 8000, a 256 MB RGBA bitmap). 0 = unlimited.
MaxLabelSide { get; set; }intMaximum width or height of a label in dots (default 32000, the ZPL maximum for ^PW/^LL). 0 = unlimited.
MaxLabels { get; set; }intMaximum number of labels produced by one Render/ProcessCommands call (default 100000); further formats are skipped.
MaxQuantity { get; set; }intUpper bound for ^PQ copies per format (default 10000). Larger quantities are clamped.
OutputFormat { get; set; }ZplOutputFormat
OutputRotation { get; set; }ZplRotation
PaperHeight { get; set; }int
PaperMargin { get; set; }int
PaperOrientation { get; set; }ZplPaperOrientationPage orientation of the output (applied to the final image / PDF sheet).
PaperWidth { get; set; }intPDF sheet layout: paper size in dots (e.g. A4 at 203 dpi = 1680 x 2376). 0 = one page per label in label size. Labels are placed left-to-right, top-to-bottom with ZplRenderSettings.PaperMargin and ZplRenderSettings.LabelGap.
PclColorMode { get; set; }PclColorModePCL raster mode.
PclCompression { get; set; }PclCompressionPCL raster compression (mode 0, 2 or 3).
PdfAuthor { get; set; }string
PdfCreator { get; set; }string
PdfKeywords { get; set; }string
PdfProducer { get; set; }stringPDF Producer metadata.
PdfSubject { get; set; }string
PdfTitle { get; set; }string
PdfVector { get; set; }boolZplOutputFormat.Pdf with vector content (shapes, barcodes, glyph outlines) instead of one image per label: crisp at any zoom. On by default; false embeds one lossless image per label at the label dpi. Field reverse (^FR/^LR) areas on mixed backgrounds and ^GF graphics are embedded as lossless images.
PngCompression { get; set; }PngCompressionPNG zlib level (speed vs. size).
Quality { get; set; }intJPEG/WebP quality 0–100.
RenderOutputIndexes { get; set; }int[]Only output these labels (0-based, in print order incl. ^PQ copies); null = all.
RfidIndicator { get; set; }ZplRfidIndicatorMarks labels with RFID commands (^RF, ^WT, ^WF, ^RQ) in previews: ZplRfidIndicator.Watermark (default) draws a grey RFID tag pictogram (about 0.86", centred, behind all label content, turned with ^PO I) like common ZPL preview tools. Only for PNG, JPEG, WebP, BMP, GIF, PDF, SVG, HTML and EPS output; never in printer languages (GRF, EPL, PCL, Fingerprint, ESC/POS) or the 1-bit TIFF/PCX files.
RfidIndicatorColor { get; set; }SKColorColour of the RFID watermark (default light grey #C0C0C0).
RfidIndicatorOpacity { get; set; }floatOpacity of the RFID watermark, 0..1 (default 1).
SvgElementAttributes { get; set; }boolVector SVG: each field group carries data-cmd, data-offset and data-length (source span in the ZPL) for hit testing.
SvgMode { get; set; }ZplSvgModeHow ZplOutputFormat.Svg is produced: ZplSvgMode.Vector (default) writes shapes, barcode modules and glyph outlines as vector paths; ZplSvgMode.TracedRaster traces the rendered bitmap into rectangles (output before version 2); ZplSvgMode.EmbeddedRaster embeds the bitmap as PNG.
SvgSelectableText { get; set; }boolVector SVG: additionally write an invisible <text> over every single-line text field so the text can be selected/searched in a browser (the visible text stays glyph outlines).
ThumbnailSize { get; set; }intWhen > 0, encoded images are scaled down so the longer edge has this many pixels.
TiffCompression { get; set; }TiffCompressionTIFF compression for ZplOutputFormat.Tiff.
TiffPixelFormat { get; set; }TiffPixelFormatTIFF sample format (CCITT compression requires 1 bit).
TraceElements { get; set; }boolCollect ZplRenderedElement information while rendering.
TransparentBackground { get; set; }boolPaper becomes transparent in PNG/WebP/GIF/TIFF output (black/white labels keep anti-aliasing as alpha).
UseSystemFonts { get; set; }boolAlso resolve ^A@ font names as installed system font families (e.g. "Arial", "Arial Bold") when they are neither registered nor supplied by ZplRenderSettings.FontProvider; unknown families then use the built-in sans font instead of font A (warning ZPL1201). Off by default (printer behaviour); the label model (Label) turns it on.
WatermarkImage { get; set; }SKBitmapImage drawn over every label (e.g. "MUSTER"/"PREVIEW"), centered and scaled to fit.
WatermarkOpacity { get; set; }floatWatermark opacity 0–1.
WriteDpiMetadata { get; set; }boolWrite the resolution into PNG (pHYs) and JPEG (JFIF density) files (off by default so existing output stays byte-identical).

Fields & Constants

FieldTypeDescription
const MaxImageBytes = 52428800intLargest encoded image accepted by the LoadImage* helpers (default 50 MB).
const MaxImageSide = 20000intLargest width/height in pixels accepted by the LoadImage* helpers.

Methods

Method SignatureReturnsDescription
static # FromJson(string json)ZplRenderSettings
static # LoadImage(string source)SKBitmapLoads an image from a data URI (data:image/png;base64,...), an existing file path or a plain base64 string (for ZplRenderSettings.BackgroundImage / ZplRenderSettings.WatermarkImage). URLs are not fetched here (no hidden network access); use ZplRenderSettings.LoadImageFromUrlAsync.
static # LoadImageFromBase64(string base64)SKBitmapDecodes a base64 encoded image.
static # LoadImageFromFile(string path)SKBitmapLoads an image file (at most ZplRenderSettings.MaxImageBytes).
static # LoadImageFromUrlAsync(Uri url, HttpClient? http = default, CancellationToken ct = default)Task<SKBitmap>Downloads and decodes an image (size-capped; pass your own http to control proxies, timeouts and allowed hosts).
# ToJson()stringSaves all settings (images as base64 PNG, colors as #AARRGGBB).
# WithBackgroundImage(string source)ZplRenderSettingsSets ZplRenderSettings.BackgroundImage from a file, data URI or base64 string (see ZplRenderSettings.LoadImage).
# WithLabelSizeInches(double width, double height)ZplRenderSettingsConvenience: sets label size from inches.
# WithLabelSizeMm(double widthMm, double heightMm)ZplRenderSettingsConvenience: sets label size from millimeters.
# WithWatermarkImage(string source, float opacity = 0.25)ZplRenderSettingsSets ZplRenderSettings.WatermarkImage from a file, data URI or base64 string (see ZplRenderSettings.LoadImage).
ZplRenderedElement Information about one rendered field (for hit-testing, editors, tests). record12 members#
public record ZplRenderedElement

Information about one rendered field (for hit-testing, editors, tests).

Constructors

SignatureDescription
# ZplRenderedElement(string Command, string Content, int X, int Y, int Width, int Height, char Orientation, bool Reverse)Information about one rendered field (for hit-testing, editors, tests).

Properties

PropertyTypeDescription
Command { get; init; }string
Content { get; init; }string
Height { get; init; }int
Orientation { get; init; }char
Reverse { get; init; }bool
SourceLength { get; init; }intLength of the field's source block up to and including ^FS (0 when unknown).
SourceOffset { get; init; }intCharacter offset of the field's first command (usually ^FO/^FT) in the ZPL source, -1 when unknown. Together with ZplRenderedElement.SourceLength it maps the element back to its ^FO…^FS block (for fields recalled with ^XF it refers to the source that defined the stored format).
Width { get; init; }int
X { get; init; }int
Y { get; init; }int

Methods

Method SignatureReturnsDescription
# Deconstruct(out string Command, out string Content, out int X, out int Y, out int Width, out int Height, out char Orientation, out bool Reverse)void
ZplRenderer Virtual ZPL printer: renders ZPL II to PNG/JPEG/WebP/BMP/PDF/GRF. Keeps printer memory (graphics, formats, fonts, label setup) … class17 members#
public sealed class ZplRenderer

Virtual ZPL printer: renders ZPL II to PNG/JPEG/WebP/BMP/PDF/GRF. Keeps printer memory (graphics, formats, fonts, label setup) between calls, like a real printer.

Thread safety: a ZplRenderer instance is not thread-safe (it keeps printer state such as ^LH/^PW/^MC between calls); use one instance per thread or synchronise access. Different instances may render concurrently and produce output identical to single-threaded rendering. A ZplResourceStore may be shared between instances (it is thread-safe); ZplRenderer.Settings must not be modified while rendering. Untrusted input is bounded by ZplRenderSettings.MaxLabelDots, ZplRenderSettings.MaxQuantity, ZplRenderSettings.MaxLabels, ZplRenderSettings.MaxGraphicBytes and ZplRenderSettings.MaxFieldDataLength. See THREADING.md.

Constructors

SignatureDescription
# ZplRenderer(ZplRenderSettings? settings = default)

Properties

PropertyTypeDescription
LastCutPlan { get; }ZplCutPlanCut plan of the last ZplRenderer.Render / ZplRenderer.ProcessCommands / ZplRenderer.RenderSvg call: where a Zebra printer with cutter cuts (^MM, ^PQ, ^XB, ^CN, ^KV, ^JU, ~JK). Always computed (no effect on the output); set ZplRenderSettings.CutMarks to also draw the cuts into previews.
LastElements { get; }IReadOnlyList<IReadOnlyList<ZplRenderedElement>>Elements of the last ZplRenderer.ProcessCommands call (if ZplRenderSettings.TraceElements).
LastRfidCommands { get; }IReadOnlyList<IReadOnlyList<ZplRfidCommand>>RFID commands of each label of the last ZplRenderer.Render / ZplRenderer.ProcessCommands call (see ZplRenderResult.RfidCommands).
PrintMode { get; }ZplPrintModePrint mode (^MM) currently in effect; persists across formats like on a printer.
Responses { get; }List<string>Responses produced for host queries (~HS, ~HI ...) during the last call.
SavedPrintMode { get; }ZplPrintModePrint mode saved with ^JUS (restored by ~JR / ZplRenderer.Reset).
Settings { get; }ZplRenderSettings
Store { get; init; }ZplResourceStoreEmulated printer memory. Can be shared between renderers.

Methods

Method SignatureReturnsDescription
# ProcessCommands(string zpl)List<byte[]>Renders ZPL and returns one encoded image per printed label (PDF: one document with all pages).
# ProcessCommands(byte[] zpl, Encoding? encoding = default)List<byte[]>Raw ZPL bytes, read like a Zebra printer (ZplTextEncoding: the code page of the active ^CI, power-up ZplRenderSettings.DefaultCodePage); a byte order mark or valid UTF-8 text is read as Unicode.
# ProcessFile(string path)List<byte[]>
# Render(string zpl)List<ZplRenderResult>Renders ZPL to bitmaps. The caller owns (and must dispose) the bitmaps.
# RenderSvg(string zpl)List<string>Renders all labels as vector SVG documents (independent of ZplRenderSettings.OutputFormat; the other settings such as ZplRenderSettings.SvgSelectableText and colours apply). Shapes, barcodes and text (glyph outlines) are vector paths; each field is a <g> with data-cmd/data-offset/data-length.
# Reset()voidClears printer memory and label setup (power-on reset).

Events

EventHandler TypeDescription
LabelRenderedEventHandler<ZplLabelRenderedEventArgs>Raised for every rendered label (after encoding).
PrinterControlEventHandler<ZplPrinterControlEventArgs>Raised for printer control commands that don't affect the image (media, darkness, status ~HS, calibration, ...). Set ZplPrinterControlEventArgs.Response to answer host queries.
ZplResourceStore Printer memory emulation: downloaded graphics (~DG, ~DY), stored formats (^DF) and fonts. Object names are case-insensitive; th… class20 members#
public sealed class ZplResourceStore

Printer memory emulation: downloaded graphics (~DG, ~DY), stored formats (^DF) and fonts. Object names are case-insensitive; the drive letter (R:, E:, B:) is ignored.

Thread-safe: all members may be called concurrently, so one store can be shared by many renderers (e.g. one ZplRenderer per thread). Downloads from ZPL (~DG, ~DY, ~DU, ^DF) are limited by ZplResourceStore.MaxTotalBytes; objects added through the API are not.

Constructors

SignatureDescription
# ZplResourceStore()

Properties

PropertyTypeDescription
CacheGraphics { get; set; }boolCache decoded ^GF graphic data, so labels repeating the same graphic (logos in every format of a job) decode it only once (default off; bounded to ZplResourceStore.MaxCachedGraphics entries). Turning it off clears the cache.
CachedGraphicCount { get; }intNumber of decoded graphics currently cached.
Fonts { get; }FontManager
Formats { get; }IReadOnlyCollection<string>
Graphics { get; }IReadOnlyCollection<string>
MaxCachedGraphics { get; set; }intMaximum number of decoded graphics kept while ZplResourceStore.CacheGraphics is on (default 64).
MaxTotalBytes { get; set; }longQuota for objects downloaded by ZPL commands (~DG, ~DY, ~DU, ^DF), in bytes (default 256 MB, 0 = unlimited). Downloads that would exceed it are ignored, like a printer with full memory.
UsedBytes { get; }longApproximate memory used by stored graphics, formats and downloaded fonts in bytes.

Methods

Method SignatureReturnsDescription
# AddFormat(string name, IEnumerable<ZplCommand> commands)void
# AddGraphic(string name, MonoBitmap graphic)void
# AddGraphic(string name, SKBitmap image, bool dither = false)void
# Clear()voidClears all downloaded objects (like a printer power cycle).
# GetFormat(string name)List<ZplCommand>
# GetGraphic(string name)MonoBitmap
# RemoveFormat(string name)bool
# RemoveGraphic(string name)bool
# RenameFont(string name, string newName)boolRenames a downloaded/registered font (false when it doesn't exist or the new name is taken).
# RenameFormat(string name, string newName)boolRenames a stored format (false when it doesn't exist or the new name is taken).
# RenameGraphic(string name, string newName)boolRenames a stored graphic (false when it doesn't exist or the new name is taken).
ZplRfidIndicator RFID marker in previews (see ZplRenderSettings.RfidIndicator). enum2 members#
public enum ZplRfidIndicator

RFID marker in previews (see ZplRenderSettings.RfidIndicator).

Values

NameValueDescription
None0No marker.
Watermark1Grey RFID tag pictogram behind the label content.
ZplRotation enum4 members#
public enum ZplRotation

Values

NameValueDescription
None0
Rotate9090
Rotate180180
Rotate270270
ZplScanProof Scan-proof (stage 1, barcode assurance): renders ZPL, then reads every barcode back from the rendered bitmap with two independe… class5 members#
public static class ZplScanProof

Scan-proof (stage 1, barcode assurance): renders ZPL, then reads every barcode back from the rendered bitmap with two independent decoders (zxing-cpp, ZXing.Net), compares the result with the data the field asks for, measures the symbol on the bitmap (X-dimension, quiet zones, bar height, clipping, overlap with other ink, module rounding) and gives a digital pre-check grade modelled on ISO/IEC 15416 (linear) and ISO/IEC 15415 (2D).

The grade describes the digital symbol at printer resolution. It is not an ISO-conformant verification and does not replace a calibrated verifier on the printed label: print physics (dot gain, darkness, speed, media, printhead wear) are not modelled. Symbologies that no decoder supports (postal, Codablock F, Code 49, Code 11 …) get the structural checks only (status ScanProofDataStatus.NotDecodable). See docs-internal/scan-proof.md.

Properties

PropertyTypeDescription
static Coverage { get; }IReadOnlyList<ScanProofCoverage>Decoder coverage of every ZPL barcode command and every stand-alone generator symbology.
static Decoders { get; }IReadOnlyList<ScanProofDecoderInfo>The decoders and whether they are available on this platform.

Fields & Constants

FieldTypeDescription
const Disclaimer = "Digital pre-check modelled on ISO/IE…"stringThe wording every report carries.

Methods

Method SignatureReturnsDescription
static # Verify(string zpl, ScanProofOptions? options = default)ScanProofReportRenders zpl and checks every barcode symbol on every label.
static # Verify(Barcode barcode, ScanProofOptions? options = default)ScanProofReportChecks a stand-alone generator barcode (Barcode) at its own Barcode.Dpi: the symbol is rendered without its interpretation text and with rotation 0 (both restored afterwards), decoded and measured like a ZPL field. ScanProofOptions.Dpi and the label settings are ignored.
ZplSvgMode How SVG output is produced (see ZplRenderSettings.SvgMode). enum3 members#
public enum ZplSvgMode

How SVG output is produced (see ZplRenderSettings.SvgMode).

Values

NameValueDescription
Vector0Vector paths for shapes, barcodes and text (glyph outlines); graphics and reversed fields as images.
TracedRaster1The rendered bitmap traced to rectangles.
EmbeddedRaster2The rendered bitmap embedded as PNG image.
ZplTextEncoding Encoding of ZPL printer bytes as a Zebra printer reads them: every byte is decoded with the single-byte code page of the ^CI th… class11 members#
public sealed class ZplTextEncoding : Encoding

Encoding of ZPL printer bytes as a Zebra printer reads them: every byte is decoded with the single-byte code page of the ^CI that is active at its position (power-up ^CI0 = Code Page 850, ^CI27 = 1252, ^CI31 = 1250, ^CI33 = 1251, ^CI34 = 1253, ^CI35 = 1254, ^CI36 = 1255). Encoding the decoded text gives the same bytes back, so tools that rewrite ZPL (format, redact, gs1 migrate) keep the field data byte-identical.

Bytes after ^CI28–30 keep the code page that was active before (a stream with UTF-8 data is decoded as UTF-8 as a whole by ZplTextEncoding.Decode). A ^CC that changes the caret is not followed.

Constructors

SignatureDescription
# ZplTextEncoding(int defaultCodePage = 850)defaultCodePage: Code page before the first ^CI (850 like a Zebra printer at power-up).

Properties

PropertyTypeDescription
EncodingName { get; }string
IsSingleByte { get; }bool
WebName { get; }string

Methods

Method SignatureReturnsDescription
static # Decode(byte[] data, out Encoding encoding, int defaultCodePage = 850)stringDecodes ZPL bytes: a byte order mark (UTF-8, UTF-16) or valid UTF-8 with non-ASCII bytes selects Unicode, anything else is read like a printer with ZplTextEncoding. encoding encodes the text back.
# GetByteCount(char[] chars, int index, int count)int
# GetBytes(char[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex)int
# GetCharCount(byte[] bytes, int index, int count)int
# GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex)int
# GetMaxByteCount(int charCount)int
# GetMaxCharCount(int byteCount)int

ZplCore.Barcodes #

57 types

Stand-alone barcode generator (144 symbologies), GS1 AI parser & validator, GS1 Digital Link URI toolkit, and symbology-specific encoders & options.

AztecFormat Aztec symbol format (Barcode.AztecFormat). enum3 members#
public enum AztecFormat

Aztec symbol format (Barcode.AztecFormat).

Values

NameValueDescription
Auto0
Compact1
Full2
Barcode Stand-alone barcode generator (no ZPL needed): set Barcode.Symbology and Barcode.Code, then export as bitmap/PNG, vector PDF/SV… class128 members#
public sealed class Barcode

Stand-alone barcode generator (no ZPL needed): set Barcode.Symbology and Barcode.Code, then export as bitmap/PNG, vector PDF/SVG/EPS, or draw onto any SKCanvas.

Not thread-safe: a Barcode is a mutable settings object; use one instance per thread (instances on different threads are independent and deterministic). Invalid data throws ArgumentException, FormatException or NotSupportedException.

Constructors

SignatureDescription
# Barcode()

Properties

PropertyTypeDescription
AddChecksum { get; set; }bool
Alignment { get; set; }BarcodeAlignmentPosition inside the target box (FitProportional / AutoSize).
AntiAlias { get; set; }boolAnti-aliased bars and modules (default off: crisp edges at whole pixels).
ArtBarImagePattern { get; set; }SKBitmapImage tiled as fill pattern of the bars / modules (instead of Barcode.ForeColor).
AztecErrorCorrection { get; set; }intAztec error correction in percent of the data (5..95, default 23).
AztecFormat { get; set; }AztecFormatAztec format (Auto = full range, as bwip-js; ZXing chooses when no other Aztec option is set).
AztecLayers { get; set; }intAztec layers (compact 1..4, full 1..32; 0 = automatic).
BackColor { get; set; }SKColor
BarHeight { get; set; }doubleBar height of linear codes (2D codes ignore it; their modules are square).
BarWidth { get; set; }doubleNarrow bar / module width.
BarWidthReduction { get; set; }doubleBar width reduction (ink spread compensation) in Barcode.Unit: every dark bar/module gets narrower by this amount.
BarWidthReductionPercent { get; set; }doubleBar width reduction in percent of the module width (added to Barcode.BarWidthReduction).
BearerBarWidth { get; set; }double
BearerBars { get; set; }BearerBarStyleBearer bars (ITF-14 frame or horizontal rules).
BorderColor { get; set; }SKColor
BorderRadius { get; set; }doubleCorner radius of the border (and background) in Barcode.Unit.
BorderWidth { get; set; }doubleBorder line width in Barcode.Unit (0 = none).
ByteEncodingName { get; set; }stringCharacter encoding of the data bytes, e.g. "ISO-8859-5", "Shift_JIS", "UTF-8": the text is converted with that encoding and an ECI designator (Eci.FromEncodingName) is placed in front. Supported by QR Code, Aztec and MaxiCode; other symbologies with ECI support throw NotSupportedException.
CodabarStartChar { get; set; }char?Codabar start character A–D when the data has none (null = A).
CodabarStopChar { get; set; }char?Codabar stop character A–D when the data has none (null = A).
Code { get; set; }string
Code128Subset { get; set; }Code128SubsetCode 128 start code set: A/B/C start in that set and keep it unless the data contains ZPL invocation codes (>5, >6, >7); Auto = shortest encoding.
Code16KMode { get; set; }Code16KModeCode 16K start mode (initial code set); Auto = BWIPP's choice.
Code16KRows { get; set; }intMinimum number of Code 16K rows (2..16, 0 = automatic).
CodeEncoding { get; set; }CodeEncoding
CodeFormatPattern { get; set; }stringPattern applied to Barcode.Code before encoding (same syntax as Barcode.TextFormatPattern).
CompositeComponent { get; set; }CompositeComponentComposite component of the GS1 composite symbologies.
DataBarSegmentsPerRow { get; set; }int
DataMatrixDmre { get; set; }boolAllow the DMRE (ISO/IEC 21471) rectangles in the automatic rectangular size selection.
DataMatrixEncodation { get; set; }DataMatrixEncodationData Matrix encodation scheme. Non-Auto values use that scheme for every character it can represent (ASCII for the rest) instead of the look-ahead optimisation.
DataMatrixSize { get; set; }stringFixed Data Matrix size "RxC" (rows × columns), e.g. "24x24", "16x48"; DMRE sizes such as "8x48" are allowed. Null = smallest fitting.
DisplayChecksum { get; set; }boolShow computed check digits in the human readable text (default true).
DisplayStartStopChar { get; set; }bool?Show Code 39 '*' / Codabar start and stop characters (null = symbology default).
DotCodeAspectRatio { get; set; }doubleDotCode width:height ratio for the automatic size (0 = 1.5).
DotCodeColumns { get; set; }intDotCode columns (at least 5, 0 = automatic).
DotCodeRows { get; set; }intDotCode rows (at least 5, 0 = automatic). With both rows and columns their sum must be odd.
Dpi { get; set; }intResolution for raster output and unit conversion.
ErrorBehavior { get; set; }BarcodeErrorBehaviorError behaviour of the outputs (Barcode.Encode always throws).
FinderShape { get; set; }FinderShape
FontSize { get; set; }doubleFont size of the human readable text in points (0 = automatic, proportional to the module).
ForeColor { get; set; }SKColor
Gs1StrictValidation { get; set; }boolGS1-128: check AI values against the GS1 syntax rules (lint) instead of plain AI parsing.
GuardBarHeight { get; set; }double?EAN/UPC guard bar extension below the bars in Barcode.Unit (null = half the text height).
GuardBars { get; set; }boolExtend EAN/UPC guard bars into the text area.
HanXinErrorCorrection { get; set; }intHan Xin error correction level 1..4 (L1..L4).
HanXinMode { get; set; }HanXinModeHan Xin: force numeric, text or binary encodation for the whole message.
HanXinVersion { get; set; }intHan Xin version 1..84 (0 = smallest fitting).
HumanReadableAlignment { get; set; }HumanReadableAlignment
HumanReadableText { get; set; }stringText instead of the encoded data (null = automatic, incl. check digits).
ItfHMarks { get; set; }boolITF-14: draw "H" marks in the quiet zones left and right of the symbol (inside the bearer frame).
JabCodeColors { get; set; }intJAB Code colours: 4, 8 (default), 16, 32, 64, 128 or 256.
JabCodeErrorCorrection { get; set; }intJAB Code error correction level 0..10 (default 6).
JabCodeMask { get; set; }intJAB Code mask 0..7 (-1 = best).
LightMarginIndicator { get; set; }boolEAN/UPC light margin indicators ('<' / '>') in the quiet zones (GS1 General Specifications).
LogoBackground { get; set; }boolDraw a plate in Barcode.BackColor behind the logo.
LogoImage { get; set; }SKBitmapLogo drawn in the center of 2D codes (QR: error correction is forced to H).
LogoOpacity { get; set; }doubleLogo opacity 0..1.
LogoPosition { get; set; }LogoPosition
LogoSizePercent { get; set; }doubleLogo width in percent of the symbol width (without quiet zone).
MagnificationFactor { get; set; }double?EAN/UPC magnification factor 0.8–2.0 (GS1 General Specifications): sets the module to 0.330 mm × factor and the bar height to 22.85 mm × factor (EAN-13, UPC-A, UPC-E and ISBN/ISSN/ISMN/JAN) or 18.23 mm × factor (EAN-8, JAN-8), overriding Barcode.BarWidth and Barcode.BarHeight. Null = off.
MaxiCodeMode { get; set; }int
MaxiCodePixelAligned { get; set; }boolMaxiCode: draw the hexagons without anti-aliasing with centres snapped to whole pixels (crisp thermal output).
MicroPdf417Columns { get; set; }intMicroPDF417 columns (1..4, 0 = automatic).
MicroPdf417Rows { get; set; }intMicroPDF417 rows (per the ISO size table, 0 = automatic).
MicroQrVersion { get; set; }intMicro QR version 1..4 (M1..M4), 0 = smallest fitting.
ModuleShape { get; set; }ModuleShape
MsiChecksum { get; set; }MsiChecksum?MSI check digits (null = mod 10, the encoder default).
Padding { get; set; }BarcodePaddingMargin around the barcode (outside the quiet zone, inside the border) in Barcode.Unit.
Pdf417AspectRatio { get; set; }doublePDF417 width:height ratio of the symbol (without quiet zone) used to choose the column count when Barcode.Pdf417Columns is 0 (0 = BWIPP default).
Pdf417Columns { get; set; }int
Pdf417Compaction { get; set; }Pdf417CompactionPDF417 compaction: Auto (text/numeric/byte optimisation), all Numeric, or all Binary (byte).
Pdf417Rows { get; set; }intPDF417 rows (3..90, 0 = automatic).
Pdf417SecurityLevel { get; set; }int
PharmacodeSpacing { get; set; }intPharmacode space between bars in modules (default 2).
PharmacodeThickBar { get; set; }intPharmacode thick bar width in modules (default 3).
PharmacodeThinBar { get; set; }intPharmacode thin bar width in modules (default 1).
PostalBarSpacing { get; set; }doublePostal codes: gap between bars in modules (default 1.5).
PostalShortBarRatio { get; set; }doublePOSTNET/PLANET short bar height as fraction of Barcode.BarHeight (default 0.4).
PostalTrackerRatio { get; set; }double4-state postal codes: tracker height as fraction of Barcode.BarHeight (default 1/3).
ProcessTilde { get; set; }boolTilde escapes: ~~ tilde, ~dNNN byte, ~1 FNC1 (GS1 when first, else GS), ~2IICC structured append (index, count, 2 digits each), ~eNNNNNN / ~5NNNNNN ECI.
QrEncodingMode { get; set; }QrEncodingModeQR Code data mode: Auto (BWIPP segmentation) or one segment in the given mode. Kanji encodes the text as Shift JIS double-byte characters.
QrErrorCorrection { get; set; }char
QrMask { get; set; }intQR mask pattern 0–7 (-1 = automatic).
QrVersion { get; set; }intQR version 1–40 (0 = smallest fitting).
QuietZone { get; set; }int?Quiet zone in modules on every side (null: 10 for linear codes and Codablock F, 4 for 2D and the other stacked codes; Code 16K and Code 49 additionally carry their 10X/1X quiet zones inside the symbol).
RectMicroQrVersion { get; set; }stringrMQR version, e.g. "R7x43" … "R17x139"; null = smallest area.
RightToLeft { get; set; }boolDraw the human readable text right to left (character order reversed).
Rotation { get; set; }intRotation in degrees (0, 90, 180, 270).
Size { get; }SKSizeSize of the barcode (incl. quiet zone and text) in pixels at Barcode.Dpi, before rotation.
Sizing { get; set; }BarcodeSizingSizing mode; needs Barcode.TargetWidth and Barcode.TargetHeight (in Barcode.Unit, final orientation).
StructuredAppendInfo { get; set; }StructuredAppendInfoStructured append for QR, Data Matrix, Aztec, MaxiCode and PDF417 (null = none).
Supplement { get; set; }stringEAN/UPC 2- or 5-digit supplement drawn right of the main symbol.
SupplementSpacing { get; set; }intEAN/UPC supplement gap in modules (default 9).
SupplementTopMargin { get; set; }double?EAN/UPC supplement: distance from the top of the main bars to the top of the supplement bars (in Barcode.Unit; null = the height of the text line).
Symbology { get; set; }Symbology
TargetHeight { get; set; }doubleOutput height for Barcode.Sizing (in Barcode.Unit).
TargetWidth { get; set; }doubleOutput width for Barcode.Sizing (in Barcode.Unit).
TextColor { get; set; }SKColor
TextFormatPattern { get; set; }stringFormat for the human readable text: a composite format such as "{0:### ### ###}" (applied to the numeric value when the text is numeric) or a mask where A a 9 # X x * ? take the next character and everything else is literal, e.g. "AAA-999".
TextPosition { get; set; }BarcodeTextPosition
TextStrikeout { get; set; }bool
TextUnderline { get; set; }bool
Tlc39Gap { get; set; }intTLC39: gap between the MicroPDF417 and the Code 39 part in modules (ZPL ^BT uses 2).
Tlc39MicroPdfRowHeight { get; set; }intTLC39: height of one MicroPDF417 row in modules (ZPL ^BT h2; default 2).
Typeface { get; set; }SKTypeface
UltracodeErrorCorrection { get; set; }intUltracode error correction level 1..5 (EC1..EC5, default 2).
Unit { get; set; }BarcodeUnitUnit of Barcode.BarWidth, Barcode.BarHeight, Barcode.BearerBarWidth.
UseQuietZoneForText { get; set; }boolLinear codes: the human readable text uses the quiet zone below (or above) the bars instead of adding height.
WideRatio { get; set; }doubleWide-to-narrow ratio for two-width codes (2.0–3.0).

Methods

Method SignatureReturnsDescription
# Draw(SKCanvas canvas, float x = 0, float y = 0)voidDraws the barcode with vector primitives onto any canvas (raster, PDF, SVG).
# Encode()BarcodeMatrixEncodes Barcode.Code to modules.
# IsCodeValid()boolTrue when Barcode.Code can be encoded with the current settings.
# IsCodeValid(out string error)boolTrue when Barcode.Code can be encoded; otherwise error describes why.
# StructuredAppend(int index, int count, int parity = -1, string? fileId = default)BarcodeSets structured append: symbol index (1-based) of count.
# ToBitmap()SKBitmap
# ToEps()stringEncapsulated PostScript (vector bars, text in Courier).
# ToEps(EpsColorMode colorMode)stringEncapsulated PostScript in the given color model (RGB, CMYK or grayscale operators).
# ToHtmlImgTag(HtmlImageFormat format = HtmlImageFormat.Png, string? alt = default)stringHTML <img> tag with the barcode as data URI.
# ToJpeg(int quality = 95)byte[]
# ToPcl()byte[]PCL5 raster page at Barcode.Dpi.
# ToPcx()byte[]1-bit PCX at Barcode.Dpi.
# ToPdf()byte[]Vector PDF with the physical size of the barcode.
# ToPng()byte[]
# ToSvg()stringVector SVG.
# ToTiff(TiffCompression compression = TiffCompression.PackBits)byte[]1-bit TIFF (via RasterExport) at Barcode.Dpi.
# ToWebp(int quality = 95)byte[]
# ToZplGraphic(int x = 0, int y = 0)stringThe barcode as ZPL graphic (^GFA) at the given position, e.g. for symbologies without a ZPL command.
BarcodeAlignment Position of the barcode inside the target box. enum9 members#
public enum BarcodeAlignment

Position of the barcode inside the target box.

Values

BarcodeEncoder Encodes data to barcode modules. 2D codes and EAN/UPC use ZXing.Net; Code 128 follows ZPL subset rules. class1 member#
public static class BarcodeEncoder

Encodes data to barcode modules. 2D codes and EAN/UPC use ZXing.Net; Code 128 follows ZPL subset rules.

Methods

Method SignatureReturnsDescription
static # Encode(BarcodeType type, string data, BarcodeOptions? options = default)BarcodeMatrix
BarcodeErrorBehavior What Barcode outputs do when the data cannot be encoded. enum3 members#
public enum BarcodeErrorBehavior

What Barcode outputs do when the data cannot be encoded.

Values

NameValueDescription
Throw0Throw the encoder exception (default).
BlankImage1Output an empty image in Barcode.BackColor.
ErrorDescriptionImage2Output an image showing the error message.
BarcodeMatrix Barcode module data independent of any output: either a 1D row of bar widths (BarcodeMatrix.Modules with a single row, true = b… class7 members#
public sealed class BarcodeMatrix

Barcode module data independent of any output: either a 1D row of bar widths (BarcodeMatrix.Modules with a single row, true = bar, one entry per narrow module) or a 2D matrix.

Constructors

SignatureDescription
# BarcodeMatrix()

Properties

PropertyTypeDescription
Height { get; }int
Is2D { get; init; }bool
required Modules { get; init; }bool[]
Text { get; init; }stringHuman readable text (incl. check digits where applicable).
UnitsPerModule { get; init; }intMatrix columns per narrow module (2 for two-width symbologies built in half units).
Width { get; }int
BarcodeOptions class10 members#
public sealed class BarcodeOptions

Constructors

SignatureDescription
# BarcodeOptions()

Properties

PropertyTypeDescription
Code128Automatic { get; set; }boolCode 128 subset optimization (ZPL ^BC mode A); false = ZPL mode N.
Code39CheckDigit { get; set; }boolAdd mod 43 check digit to Code 39 (^B3 e).
Interleaved2of5CheckDigit { get; set; }bool
MsiCheckDigits { get; set; }MsiChecksumMSI check digits (ZPL ^BM e: A none, B one mod 10 = default, C two mod 10, D mod 11 + mod 10).
MsiCheckDigitsInText { get; set; }boolMSI: the check digits are part of BarcodeMatrix.Text (ZPL ^BM e2, Zebra default N).
Pdf417Columns { get; set; }int
Pdf417SecurityLevel { get; set; }intPDF417 security level 0..8 (ZPL ^B7 s).
QrErrorCorrection { get; set; }charQR error correction L/M/Q/H.
WideRatio { get; set; }doubleWide:narrow ratio for two-width symbologies (ZPL ^BY r, 2.0..3.0).
BarcodePadding Space around the barcode in Barcode.Unit. struct8 members#
public readonly record struct BarcodePadding

Space around the barcode in Barcode.Unit.

Constructors

SignatureDescription
# BarcodePadding(double all)
# BarcodePadding(double Left, double Top, double Right, double Bottom)Space around the barcode in Barcode.Unit.

Properties

PropertyTypeDescription
Bottom { get; init; }double
IsEmpty { get; }bool
Left { get; init; }double
Right { get; init; }double
Top { get; init; }double

Methods

Method SignatureReturnsDescription
# Deconstruct(out double Left, out double Top, out double Right, out double Bottom)void
BarcodeSizing How the barcode is fitted into Barcode.TargetWidth × Barcode.TargetHeight. enum4 members#
public enum BarcodeSizing

How the barcode is fitted into Barcode.TargetWidth × Barcode.TargetHeight.

Values

NameValueDescription
None0Natural size from the module width and bar height; the target is ignored.
Fill1Stretch to fill the target (width and height scaled independently).
FitProportional2Scale uniformly to fit inside the target, positioned by Barcode.Alignment.
AutoSize3Largest whole-pixel module width whose symbol fits the target (bars stay crisp), positioned by Barcode.Alignment.
BarcodeTextPosition enum5 members#
public enum BarcodeTextPosition

Values

NameValueDescription
None0
Below1
Above2
Left3
Right4
BarcodeType enum15 members#
public enum BarcodeType

Values

BarcodeUnit enum6 members#
public enum BarcodeUnit

Values

NameValueDescription
Pixel0
Millimeter1
Inch2
Mil3
Centimeter4
Micrometer5
BarcodeVariants Application / data-format variants built on the existing carrier encoders (Code 128, GS1-128, ITF, Code 39, EAN, Data Matrix, Q… class31 members#
public static class BarcodeVariants

Application / data-format variants built on the existing carrier encoders (Code 128, GS1-128, ITF, Code 39, EAN, Data Matrix, QR, Aztec, Codablock F, MicroPDF417): input validation, check digits and human readable text per the respective carrier or industry specification.

Methods

Method SignatureReturnsDescription
static # DhlAwb(string number)BarcodeMatrixDHL Air Waybill: 10 digits, last digit = first nine digits mod 7, in Code 128 C.
static # Dun14Ean14(string data)BarcodeMatrixDUN-14 as GS1-128 (AI 01).
static # Dun14Itf(string data)BarcodeMatrixDUN-14 as ITF-14 (check computed or verified).
static # Ean99(string data)BarcodeMatrixEAN-99 (in-store coupon): EAN-13 starting with 99. 12 or 13 digits.
static # FedExGround96(string number)BarcodeMatrixFedEx Ground "96" barcode: 22 digits starting with 96 as GS1-128 (AI 96). The last 15 digits are the tracking number whose last digit is a mod 10 (3/1) check.
static # HibcAztec(string data)BarcodeMatrixHIBC LIC/PAS in Aztec Code (BWIPP hibcazteccode).
static # HibcCodablockF(string data)BarcodeMatrixHIBC LIC/PAS in Codablock F (BWIPP hibccodablockf).
static # HibcDataMatrix(string data)BarcodeMatrixHIBC LIC/PAS in Data Matrix (BWIPP hibcdatamatrix).
static # HibcMessage(string data)stringHIBC message: "+" + data + mod 43 check (BWIPP hibc* encoders).
static # HibcMicroPdf417(string data, int columns = 2)BarcodeMatrixHIBC LIC/PAS in MicroPDF417 (BWIPP hibcmicropdf417, default 2 columns).
static # HibcQr(string data)BarcodeMatrixHIBC LIC/PAS in QR Code (BWIPP hibcqrcode, EC level M).
static # IfaDataMatrix(string ppn, string? batch = default, string? expiry = default, string? serial = default)BarcodeMatrixIFA securPharm / PPN Data Matrix: ISO/IEC 15434 format 06 "[)>RS06GS9N{PPN}GS1T{batch}GSD{YYMMDD}GSS{serial}RSEOT". Optional elements are left out when null. ppn may be an 8-digit PZN.
static # Isbt128(string data)BarcodeMatrixISBT 128 data structure in Code 128: data identifier "=" or "&" + second character + data. For the Donation Identification Number ("=" + 13 chars + 2 flag chars) the human readable carries the mod 37-2 check character (computed over the 13 DIN characters) after the flags; it is not encoded.
static # Isbt128DataMatrix(string data)BarcodeMatrixISBT 128 Data Matrix: compound message "=+" + data structures (ICCBBA ST-014) in Data Matrix.
static # ItalianPost2of5(string number)BarcodeMatrixItalian Post 2 of 5: Interleaved 2 of 5 with appended mod 10 check digit (leading zero pad to even).
static # Jan8(string data)BarcodeMatrixJAN-8: EAN-8 whose GS1 prefix is 45 or 49 (Japan). 7 or 8 digits.
static # Mod10(string digits)charGS1 mod 10 (weights 3/1 from the right) check digit of a digit string.
static # Mod37_2(string s)charISO 7064 mod 37-2 check character (ICCBBA ISBT 128 keyboard check; values 0-9, A-Z, '*').
static # Numly(string number)BarcodeMatrixNumly Number: 19 digits in Code 39.
static # Ppn(string pznOrPpn)stringIFA PPN: "11" + PZN (8 digits) + 2 check digits (Σ ASCII·weight, weights 2,3,4,… mod 97).
static # PpnDataMatrix(string ppn)BarcodeMatrixIFA PPN-only Data Matrix (format 06 with DI 9N).
static # Semacode(string url)BarcodeMatrixSemacode: a URL encoded in Data Matrix.
static # SwissPostParcel(string number)BarcodeMatrixSwiss Post parcel number: 18 digits in Code 128 (subset C), text grouped "98.xx.xxxxxx.xxxxxxxx".
static # UspsImpb(string tracking, string? zip = default)BarcodeMatrixUSPS Intelligent Mail package barcode (IMpb) / Package Identification Code: GS1-128 with optional routing AI (420) ZIP (5, 9 or 11 digits) followed by the tracking number whose first two digits are the application identifier 91, 92, 93, 94 or 95. The tracking number's last digit is a GS1 mod 10 check (appended when omitted, 22 or 26 digits total incl. the AI).
static # UspsPic(string tracking, string? zip = default)BarcodeMatrixUSPS PIC: same structure as BarcodeVariants.UspsImpb, typically AI 91 (no routing).
static # UspsSackLabel(string number)BarcodeMatrixUSPS 8-digit sack label (Interleaved 2 of 5).
static # UspsTrayLabel(string number)BarcodeMatrixUSPS 24-digit tray label (Interleaved 2 of 5).
static # VicsBol(string number)BarcodeMatrixVICS Bill of Lading number: 17 digits (GS1 company prefix + serial + mod 10 check) in Code 128 C.
static # VicsScacPro(string scac, string pro)BarcodeMatrixVICS SCAC PRO: 4-letter carrier SCAC + PRO number in Code 128 (digits use subset C).
static # VinDataMatrix(string vin)BarcodeMatrixVIN as Data Matrix.
static # VinQr(string vin)BarcodeMatrixVIN as QR Code (EC level M).
BearerBarStyle enum3 members#
public enum BearerBarStyle

Values

NameValueDescription
None0
Frame1
HorizontalRules2
Checksums Public check digit algorithms used by the barcode symbologies (GS1 mod 10, Luhn, mod 11, Code 39 mod 43, Code 93 mod 47, ISO/IE… class18 members#
public static class Checksums

Public check digit algorithms used by the barcode symbologies (GS1 mod 10, Luhn, mod 11, Code 39 mod 43, Code 93 mod 47, ISO/IEC 7064, UPU S10, MSI variants …). All methods take the data without the check character.

Methods

Method SignatureReturnsDescription
static # CodabarMod16(string data)charCodabar mod 16 check character over the data including start/stop characters.
static # Code11(string data, bool twoDigits = true)stringCode 11 C (and with twoDigits also K) check digits; '-' counts as 10.
static # Code39Mod43(string data)charCode 39 mod 43 check character.
static # Code93Mod47(string data)stringCode 93 check characters C and K (mod 47, weights 1..20 and 1..15). Data must be in the Code 93 basic set.
static # DeutschePostMod10(string digits)intDeutsche Post Leitcode / Identcode check digit (weights 4 and 9 from the left).
static # DeutschePostMod11(string digits)intDeutsche Post mod 11 (weights 2..7 from the right; results 10 and 11 become 0).
static # IsValidMod10(string digitsWithCheck)boolTrue when the last digit of digitsWithCheck is its GS1 mod 10 check digit.
static # Iso7064Mod11_10(string digits)intISO/IEC 7064 MOD 11-10 (hybrid system, numeric).
static # Iso7064Mod37_2(string data)charISO/IEC 7064 MOD 37-2 (alphanumeric, check character 0-9, A-Z or '*'); used by ISBT 128.
static # Iso7064Mod97_10(string data)intISO/IEC 7064 MOD 97-10 (as in IBAN): returns the two check digits 02..98.
static # Luhn(string digits)intLuhn (mod 10, double every second digit from the right); also the MSI mod 10 check.
static # Mod10(string digits)intGS1 mod 10 (weights 3,1 from the right): EAN/UPC, ITF-14, SSCC, GTIN, GLN.
static # Mod10Weighted(string digits, params int[] weightsFromRight)intWeighted mod 10 with the given weights applied from the right (cycling), result (10 - sum mod 10) mod 10.
static # Mod11(string digits, int maxWeight = 7)intMod 11 with weights 2..maxWeight from the right; returns 0..10 (10 is usually printed as 'X').
static # Msi(string digits, MsiChecksum kind)stringMSI check digits: "Mod10", "Mod11", "Mod1010" (two mod 10) or "Mod1110" (mod 11 then mod 10).
static # Ppn(string data)stringPPN (pharmacy product number) check digits: mod 97 over the character values with weights 2, 3, 4 …
static # UpuS10(string serial8)intUPU S10 check digit over the 8-digit serial number (weights 8,6,4,2,3,5,9,7).
static # Vin(string vin)charVIN check character (position 9) of a 17-character VIN (the check position itself is ignored).
Codablock Codablock F (stacked Code 128), port of BWIPP codablockf. The matrix reproduces bwip-js pixs exactly: a 1-module separator abov… class3 members#
public static class Codablock

Codablock F (stacked Code 128), port of BWIPP codablockf. The matrix reproduces bwip-js pixs exactly: a 1-module separator above and below, each data row repeated Codablock.RowHeight times and a Codablock.SepHeight-row separator between rows.

Fields & Constants

FieldTypeDescription
const RowHeight = 10intbwip-js default rowheight (matrix rows per symbol row).
const SepHeight = 1intbwip-js default sepheight (matrix rows per separator).

Methods

Method SignatureReturnsDescription
static # Encode(string data, int columns = 0, int rows = 0)BarcodeMatrixEncode data (Latin-1 chars) as Codablock F. columns 4..62 (0 = 8), rows 2..44 (0 = automatic).
Code128 Code 128 encoder (ISO/IEC 15417). Automatic subset selection, with support for the ZPL invocation codes in mode N: >9 start … class1 member#
public static class Code128

Code 128 encoder (ISO/IEC 15417). Automatic subset selection, with support for the ZPL invocation codes in mode N: >9 start A, >: start B, >; start C, >8 FNC1, >5 switch to C, >6 switch to B, >7 switch to A.

Methods

Method SignatureReturnsDescription
static # Encode(string data, out string text, bool automatic = true)bool[]Returns modules (true = bar) and the human readable text. automatic: true = optimize subsets (ZPL mode A); false = ZPL mode N: subset B unless the data starts with an invocation code, and no implicit switching to subset C. The data to encode, possibly containing ZPL invocation codes.Receives the human readable interpretation.
Code128Subset Code 128 start code set (Barcode.Code128Subset). enum4 members#
public enum Code128Subset

Code 128 start code set (Barcode.Code128Subset).

Values

NameValueDescription
Auto0
A1
B2
C3
Code16KMode enum4 members#
public enum Code16KMode

Values

NameValueDescription
Auto0
Mode01
Mode12
Mode23
CodeEncoding How Barcode.Code is interpreted before encoding. enum3 members#
public enum CodeEncoding

How Barcode.Code is interpreted before encoding.

Values

NameValueDescription
Text0
Base641
Hex2
ColorMatrix A colour module matrix. ColorMatrix.Cells is indexed [x, y] and holds BWIPP colour indices: 0 = white (FFFFFF), 9 = black (0000… class5 members#
public sealed class ColorMatrix

A colour module matrix. ColorMatrix.Cells is indexed [x, y] and holds BWIPP colour indices: 0 = white (FFFFFF), 9 = black (000000), 1 = cyan (00FFFF), 3 = magenta (FF00FF), 5 = yellow (FFFF00), 6 = green (00FF00).

Constructors

SignatureDescription
# ColorMatrix(int width, int height)Creates an empty matrix.

Properties

PropertyTypeDescription
Cells { get; }int[]Colour indices, [x, y].
Height { get; }intHeight in modules.
Width { get; }intWidth in modules.

Fields & Constants

FieldTypeDescription
static readonly PaletteIReadOnlyDictionary<int, (string, string)>Colour index to (name, RGB hex) as defined by BWIPP's ultracode colormap.
CompositeComponent GS1 composite component (Barcode.CompositeComponent). enum4 members#
public enum CompositeComponent

GS1 composite component (Barcode.CompositeComponent).

Values

NameValueDescription
Auto0CC-A, growing to CC-B (and to CC-C for GS1-128) when the data does not fit.
CcA1Same as CompositeComponent.Auto: CC-A is used whenever the data fits.
CcB2CC-B (MicroPDF417 based) even when CC-A would fit.
CcC3CC-C (PDF417 based); GS1-128 composites only.
DataMatrixEncodation Data Matrix encodation scheme (Barcode.DataMatrixEncodation). enum7 members#
public enum DataMatrixEncodation

Data Matrix encodation scheme (Barcode.DataMatrixEncodation).

Values

NameValueDescription
Auto0
Ascii1
C402
Text3
X124
Edifact5
Base2566
Eci AIM Extended Channel Interpretation numbers of the common character encodings (AIM ITS/04-023). class2 members#
public static class Eci

AIM Extended Channel Interpretation numbers of the common character encodings (AIM ITS/04-023).

Methods

Method SignatureReturnsDescription
static # FromEncodingName(string name)intECI number of an encoding name (IANA/.NET web name), e.g. "ISO-8859-5" → 7, "UTF-8" → 26.
static # GetEncoding(string name)EncodingThe .NET encoding of a name, including the code page encodings (Shift_JIS, windows-125x, Big5 …).
EpsColorMode enum3 members#
public enum EpsColorMode

Values

NameValueDescription
Rgb0
Cmyk1
Gray2
FinderShape Shape of the three QR finder patterns (7 × 7). enum3 members#
public enum FinderShape

Shape of the three QR finder patterns (7 × 7).

Values

NameValueDescription
Square0
Rounded1
Circle2
Gs1 GS1 Application Identifier parser and linter, following BWIPP's gs1process (AI table extracted from the GS1 Syntax Dictionary a… class8 members#
public static class Gs1

GS1 Application Identifier parser and linter, following BWIPP's gs1process (AI table extracted from the GS1 Syntax Dictionary as shipped in BWIPP). Accepts bracketed element strings "(01)…(10)…" and raw FNC1-separated strings (GS U+001D, "^FNC1" or a leading "]C1"/"]e0"/"]d2"/"]Q3" symbology identifier).

Fields & Constants

FieldTypeDescription
const GS = charGroup separator used for FNC1 in raw strings.

Methods

Method SignatureReturnsDescription
static # NeedsSeparator(string ai)boolTrue when an FNC1 separator must follow this AI's value (unless it is last).
static # Parse(string s, bool lintReqs = false)Gs1ResultParses either bracketed or raw form, depending on whether it starts with '('.
static # ParseBracketed(string s, bool lintReqs = false)Gs1ResultParses "(AI)value(AI)value…" and lints it.
static # ParseRaw(string raw, bool lintReqs = false)Gs1ResultParses a raw FNC1-separated string (AIs and values concatenated) and lints it.
static # ToElementString(IEnumerable<Gs1Element> els)string"(AI)value…" form.
static # ToRaw(IReadOnlyList<Gs1Element> els, string separator = "")stringRaw form: AI+value concatenated, separator after variable-length values (not after the last).
static # Validate(IReadOnlyList<Gs1Element> els, bool lintReqs = false)List<Gs1Error>Validates values against the AI table (BWIPP gs1process lint), optionally checking requisite AIs.
Gs1Builder Helpers to build GS1 element strings ("(AI)value…") for the GS1 symbologies. class10 members#
public static class Gs1Builder

Helpers to build GS1 element strings ("(AI)value…") for the GS1 symbologies.

Methods

Method SignatureReturnsDescription
static # Build(params (string, string)[] elements)stringElement string of (AI, value) pairs, e.g. Build(("01", gtin), ("10", "LOT1")).
static # CheckDigit(string digits)intGS1 mod-10 check digit of a digit string (GTIN, SSCC, GLN …).
static # Date(string ai, DateOnly date)stringDate AI value YYMMDD, e.g. Date("17", expiry) for (17) expiration date.
static # Element(string ai, string value)stringOne element "(AI)value".
static # Gtin(string gtin)stringAI (01): GTIN-8/12/13/14 padded to 14 digits; a 7/11/12/13-digit input gets its check digit.
static # IsKnownAi(string ai)boolTrue when the AI is defined in the GS1 table.
static # IsValidCheckDigit(string digitsWithCheck)boolTrue when the last digit is the correct GS1 check digit.
static # Measure(string ai3, decimal value, int decimals)stringMeasure AI with implied decimal point: ai3 is the 3-digit base (e.g. "310" net weight kg), the 4th digit is the number of decimals; value padded to 6 digits. Measure("310", 1.5m, 3) → "(3103)001500".
static # Sscc(string sscc)stringAI (00): SSCC from 17 digits (check digit added) or 18 digits (validated).
static # WithCheckDigit(string digits)stringDigits with their GS1 check digit appended.
Gs1DigitalLinkIssue A problem found while parsing or building a GS1 Digital Link URI. Gs1DigitalLinkIssue.Code is stable (see Gs1DigitalLink for th… record5 members#
public record Gs1DigitalLinkIssue

A problem found while parsing or building a GS1 Digital Link URI. Gs1DigitalLinkIssue.Code is stable (see Gs1DigitalLink for the list); Gs1DigitalLinkIssue.Message is for humans and may change between versions.

Constructors

SignatureDescription
# Gs1DigitalLinkIssue(string Code, string Message, string? Ai = default)A problem found while parsing or building a GS1 Digital Link URI. Gs1DigitalLinkIssue.Code is stable (see Gs1DigitalLink for the list); Gs1DigitalLinkIssue.Message is for humans and may change between versions. Code: Stable code, e.g. "qualifierOrder" or "gtinLength". · Message: Explanation in English. · Ai: The Application Identifier concerned, if any.

Properties

PropertyTypeDescription
Ai { get; init; }stringThe Application Identifier concerned, if any.
Code { get; init; }stringStable code, e.g. "qualifierOrder" or "gtinLength".
Message { get; init; }stringExplanation in English.

Methods

Method SignatureReturnsDescription
# Deconstruct(out string Code, out string Message, out string Ai)void
Gs1DigitalLinkParseOptions Options for Gs1DigitalLink.Parse. class4 members#
public sealed class Gs1DigitalLinkParseOptions

Options for Gs1DigitalLink.Parse.

Constructors

SignatureDescription
# Gs1DigitalLinkParseOptions()

Properties

PropertyTypeDescription
DecodeLegacyCompression { get; init; }boolTry to decode URIs that use the legacy compression of the GS1 Digital Link Standard 1.1/1.2 (superseded, see Gs1DigitalLink.Decompress). Default true.
PermitConvenienceAlphas { get; init; }boolAccept the convenience alphas (/gtin/, /lot/, /ser/ …) with a warning (removed from the standard in URI Syntax 1.3.0). Default false: they are an error.
PermitZeroSuppressedGtin { get; init; }boolAccept a GTIN-8/12/13 in AI (01) and pad it to 14 digits, with a warning (legacy form; URI Syntax 1.4.0 and later require 14 digits). Default false: a short GTIN is an error.
Gs1DigitalLinkResult Result of Gs1DigitalLink.Parse. class20 members#
public sealed class Gs1DigitalLinkResult

Result of Gs1DigitalLink.Parse.

Properties

PropertyTypeDescription
DataAttributes { get; }IReadOnlyList<Gs1Element>Data attributes from the query string in URI order (values percent-decoded).
Elements { get; }IReadOnlyList<Gs1Element>Gs1DigitalLinkResult.PathElements followed by Gs1DigitalLinkResult.DataAttributes.
Errors { get; }IReadOnlyList<Gs1DigitalLinkIssue>Violations of the URI syntax or of the AI rules; empty for a conformant URI.
ExtensionParameters { get; }IReadOnlyList<KeyValuePair<string, string>>Query parameters that are not GS1 AIs (extension parameters such as linkType=gs1:pip), percent-decoded.
Fragment { get; }stringFragment after '#' (not sent to a server; ignored for the GS1 data), or null.
Gtin { get; }stringThe GTIN (AI 01) in the path or query, or null.
Host { get; }stringHost name with optional port, e.g. "id.gs1.org" or "brand.example.com:8443".
IsCompressed { get; }boolThe URI uses the legacy compression (decoded by Gs1DigitalLink.Decompress).
IsValid { get; }boolGs1DigitalLinkResult.IsDigitalLink and no errors.
PathElements { get; }IReadOnlyList<Gs1Element>Primary key and key qualifiers in path order (values percent-decoded).
PrimaryKey { get; }stringAI of the primary key in the path (e.g. "01"), or null.
Scheme { get; }string"http", "https", "HTTP" or "HTTPS" (empty when the scheme is missing or not allowed).
Stem { get; }stringEverything before the GS1 path: scheme, host and any custom path segments, e.g. "https://brand.example.com/p". Pass it to Gs1DigitalLink.Build to rebuild a URI on the same stem.
Uri { get; }stringThe input.
Warnings { get; }IReadOnlyList<Gs1DigitalLinkIssue>Recommendations and tolerated legacy forms (http instead of https, compressed form …).

Methods

Method SignatureReturnsDescription
# ToCanonicalUri()stringThe canonical GS1 Digital Link URI (URI Syntax 1.7.0 §4.12): https://id.gs1.org, the same path, only AI data attributes in lexical order of the AI, no extension parameters, no trailing slash.
# ToElementString(bool bracketed = true)stringThe GS1 element string with the same data: primary key first, then the other AIs of predefined length, then the variable-length AIs (path before query), bracketed "(01)…(17)…(10)…" or raw with GS (U+001D) separators.
# ToString()string
# Value(string ai)stringValue of the first element with this AI (path or query), or null.
Gs1Element One GS1 element: Application Identifier and its value. record4 members#
public record Gs1Element

One GS1 element: Application Identifier and its value.

Constructors

SignatureDescription
# Gs1Element(string Ai, string Value)One GS1 element: Application Identifier and its value.

Properties

PropertyTypeDescription
Ai { get; init; }string
Value { get; init; }string

Methods

Method SignatureReturnsDescription
# Deconstruct(out string Ai, out string Value)void
Gs1Error A GS1 validation error (BWIPP error code without the "bwipp." prefix, and message). record5 members#
public record Gs1Error

A GS1 validation error (BWIPP error code without the "bwipp." prefix, and message).

Constructors

SignatureDescription
# Gs1Error(string Ai, string Code, string Message)A GS1 validation error (BWIPP error code without the "bwipp." prefix, and message).

Properties

PropertyTypeDescription
Ai { get; init; }string
Code { get; init; }string
Message { get; init; }string

Methods

Method SignatureReturnsDescription
# Deconstruct(out string Ai, out string Code, out string Message)void
Gs1Result Parsed GS1 data and any validation errors. record5 members#
public record Gs1Result

Parsed GS1 data and any validation errors.

Constructors

SignatureDescription
# Gs1Result(IReadOnlyList<Gs1Element> Elements, IReadOnlyList<Gs1Error> Errors)Parsed GS1 data and any validation errors.

Properties

PropertyTypeDescription
Elements { get; init; }IReadOnlyList<Gs1Element>
Errors { get; init; }IReadOnlyList<Gs1Error>
IsValid { get; }bool

Methods

Method SignatureReturnsDescription
# Deconstruct(out IReadOnlyList<Gs1Element> Elements, out IReadOnlyList<Gs1Error> Errors)void
HanXinMode Code 16K start mode (Barcode.Code16KMode): initial code set A, B or C. enum4 members#
public enum HanXinMode

Code 16K start mode (Barcode.Code16KMode): initial code set A, B or C.

Values

NameValueDescription
Auto0
Numeric1
Text2
Binary3
HtmlImageFormat enum4 members#
public enum HtmlImageFormat

Values

NameValueDescription
Png0
Jpeg1
Webp2
Svg3
HumanReadableAlignment enum4 members#
public enum HumanReadableAlignment

Values

NameValueDescription
Center0
Left1
Right2
Justify3
Isbt128Data Builds ISBT 128 data structure strings (data identifier + validated content) for Symbology.Isbt128. class3 members#
public static class Isbt128Data

Builds ISBT 128 data structure strings (data identifier + validated content) for Symbology.Isbt128.

Methods

Method SignatureReturnsDescription
static # Build(Isbt128DataStructure ds, string content)stringData identifier + content, e.g. Build(ExpirationDate, "024365") → "=>024365".
static # Describe(Isbt128DataStructure ds)(string, int)Data identifier and content length of ds.
static # DinCheckCharacter(string din13)charThe ISO/IEC 7064 MOD 37-2 keyboard check character of a 13-character DIN (printed, not encoded).
Isbt128DataStructure ISBT 128 data structures (ICCBBA ST-001) with their data identifiers. enum11 members#
public enum Isbt128DataStructure

ISBT 128 data structures (ICCBBA ST-001) with their data identifiers.

Values

NameValueDescription
DonationIdentificationNumber1DS001 Donation Identification Number: "=" + αppppyynnnnnn + flags ff (15 characters).
BloodGroups2DS002 Blood Groups [ABO and RhD]: "=%" + ggre.
ProductCode3DS003 Product Code: "=<" + αooootds.
ExpirationDate4DS004 Expiration Date: "=>" + cyyjjj.
ExpirationDateAndTime5DS005 Expiration Date and Time: "&>" + cyyjjjhhmm.
CollectionDate6DS006 Collection Date: "=*" + cyyjjj.
CollectionDateAndTime7DS007 Collection Date and Time: "&*" + cyyjjjhhmm.
ProductionDate8DS008 Production Date: "=}" + cyyjjj.
ProductionDateAndTime9DS009 Production Date and Time: "&}" + cyyjjjhhmm.
SpecialTestingGeneral10DS010 Special Testing: General: "&(" + zzzzz.
SpecialTestingRbcAntigens11DS011 Special Testing: Red Blood Cell Antigens: "={" + 18 characters.
JabCode JAB Code (ISO/IEC 23634, BSI TR-03137) master symbol, ported from BWIPP jabcode (beta): byte-mode encoding, LDPC error correcti… class2 members#
public static class JabCode

JAB Code (ISO/IEC 23634, BSI TR-03137) master symbol, ported from BWIPP jabcode (beta): byte-mode encoding, LDPC error correction, pseudorandom interleaving, 4..256 colours, automatic mask selection. Cascaded (slave) symbols are not supported, as in BWIPP.

Methods

Method SignatureReturnsDescription
static # Encode(string data, int colors = 8, int eclevel = 6, int rows = -1, int columns = -1, int mask = -1)JabCodeSymbolEncodes data (UTF-8 bytes). data: Text to encode. · colors: 4, 8, 16, 32, 64, 128 or 256 colours (ISO/IEC 23634 default 8; BWIPP defaults to 16). · eclevel: Error correction level 0..10 (code rate 0.67 .. 0.14; default 6). · rows: Fixed rows (21..145, -1 = automatic). · columns: Fixed columns (21..145, -1 = automatic). · mask: Mask pattern 0..7 (-1 = best).
static # Encode(byte[] msg, int colors = 8, int eclevel = 6, int rows = -1, int columns = -1, int mask = -1)JabCodeSymbolEncodes raw bytes.
JabCodeSymbol A JAB Code symbol: palette indices per module ([x, y]) and the palette as RGB hex strings. class4 members#
public sealed class JabCodeSymbol

A JAB Code symbol: palette indices per module ([x, y]) and the palette as RGB hex strings.

Properties

PropertyTypeDescription
Cells { get; }int[]Palette index per module, [x, y].
Height { get; }int
Palette { get; }IReadOnlyList<string>RGB hex ("RRGGBB") per palette index.
Width { get; }int
LogoPosition Position of the logo of 2D codes. enum3 members#
public enum LogoPosition

Position of the logo of 2D codes.

Values

NameValueDescription
Center0
Top1
Bottom2
MicroPdf417 MicroPDF417 (ISO/IEC 24728), bit-exact with BWIPP micropdf417 (non-composite). Data is UTF-8 bytes (as bwip-js; ^BF as a Zebra … class2 members#
public static class MicroPdf417

MicroPDF417 (ISO/IEC 24728), bit-exact with BWIPP micropdf417 (non-composite). Data is UTF-8 bytes (as bwip-js; ^BF as a Zebra printer: Latin-1 bytes). Output matrix equals bwip-js pixs (no quiet zone): each symbol row is repeated MicroPdf417.RowHeight times.

Fields & Constants

FieldTypeDescription
const RowHeight = 2intBWIPP default row multiplier (each symbol row is 2 modules high in bwip-js pixs).

Methods

Method SignatureReturnsDescription
static # Encode(string data, int columns = 0, int rows = 0)BarcodeMatrixEncodes data; columns 1..4 and rows (per the size table) are optional constraints (0 = auto smallest).
ModuleShape Shape of the dark modules of 2D matrix codes. enum7 members#
public enum ModuleShape

Shape of the dark modules of 2D matrix codes.

Values

MsiChecksum MSI Plessey check digit variants. enum5 members#
public enum MsiChecksum

MSI Plessey check digit variants.

Values

NameValueDescription
None0
Mod101
Mod112
Mod10103
Mod11104
Pdf417 PDF417 (ISO/IEC 15438) encoder, bit-exact with BWIPP pdf417 / pdf417compact. Data is taken as UTF-8 bytes (as bwip-js does; ^B7… class4 members#
public static class Pdf417

PDF417 (ISO/IEC 15438) encoder, bit-exact with BWIPP pdf417 / pdf417compact. Data is taken as UTF-8 bytes (as bwip-js does; ^B7 as a Zebra printer: Latin-1 bytes). Output matrix equals bwip-js pixs (no quiet zone): each symbol row is repeated Pdf417.RowHeight times (matrix row y = symbol row y / RowHeight).

Fields & Constants

FieldTypeDescription
const RowHeight = 3intBWIPP default row multiplier (each symbol row is 3 modules high in bwip-js pixs).

Methods

Method SignatureReturnsDescription
static # Codewords(string data, int columns = 0, int rows = 0, int eccLevel = -1)int[]Full codeword sequence (length descriptor, data, padding, ECC) as BWIPP builds it; also returns the geometry.
static # Encode(string data, int columns = 0, int rows = 0, int eccLevel = -1, bool compact = false)BarcodeMatrixEncodes data. columns 1..30 (0 = auto), rows 3..90 (0 = auto, minimum), eccLevel 0..8 (-1 = auto).
static # EncodeMacro(string data, int segmentIndex, int segmentCount, string fileId, int columns = 0, int rows = 0, int eccLevel = -1, bool compact = false)BarcodeMatrixMacro PDF417 segment: data codewords followed by the macro control block (928, segment index, file id, optional 923/001 segment count, 922 terminator on the last segment). fileId is a digit string split into 3-digit codewords (e.g. "017053" → 017, 053).
Pdf417Compaction PDF417 compaction mode (Barcode.Pdf417Compaction). enum3 members#
public enum Pdf417Compaction

PDF417 compaction mode (Barcode.Pdf417Compaction).

Values

NameValueDescription
Auto0
Numeric1
Binary2
PostalExtra Additional postal / logistics symbologies ported from zint: Korea Post, Royal Mail Mailmark 4-state (C and L), DPD, UPU S10, De… class6 members#
public static class PostalExtra

Additional postal / logistics symbologies ported from zint: Korea Post, Royal Mail Mailmark 4-state (C and L), DPD, UPU S10, Deutsche Post Flattermarken and IBM BC412.

Methods

Method SignatureReturnsDescription
static # Bc412(string data)BarcodeMatrixIBM BC412 (SEMI T1-95): 7–18 characters of 0-9, A-Z except O; check character inserted at position 2.
static # Dpd(string data, bool relabel = false)BarcodeMatrixDPD parcel code: 27 alphanumerics (the "%" identification tag is prepended) or 28 characters including the tag; relabel = 27 characters without tag. Code 128 with mod 36 check character in the text.
static # Flattermarken(string data)BarcodeMatrixDeutsche Post Flattermarken: up to 128 digits.
static # KoreaPost(string data)BarcodeMatrixKorea Post: up to 6 digits (zero-filled on the left) plus a mod-10 check digit.
static # Mailmark4State(string data)BarcodeMatrixRoyal Mail Mailmark 4-state barcode C (22 characters, shorter input space-padded) or L (26 characters): format, version ID, class, supply chain ID (2/6 digits), item ID (8 digits), postcode + DPS (9 characters).
static # UpuS10(string data)BarcodeMatrixUPU S10 item identifier: 2 letters, 8 digits (+ optional check digit), 2-letter country code.
QrEncodingMode QR Code data mode (Barcode.QrEncodingMode). enum5 members#
public enum QrEncodingMode

QR Code data mode (Barcode.QrEncodingMode).

Values

NameValueDescription
Auto0
Numeric1
Alphanumeric2
Byte3
Kanji4
QrExtras GS1 QR Code, Swiss QR Code and EPC (SEPA credit transfer) QR helpers. class5 members#
public static class QrExtras

GS1 QR Code, Swiss QR Code and EPC (SEPA credit transfer) QR helpers.

Methods

Method SignatureReturnsDescription
static # Epc(string payload)BarcodeMatrixEPC QR (girocode) symbol: the payload encoded as UTF-8 at EC level M.
static # EpcPayload(string name, string iban, decimal? amount = default, string? bic = default, string? remittance = default, string? reference = default, string? purpose = default, string? information = default)stringBuilds an EPC069-12 (version 002, UTF-8) SEPA Credit Transfer QR payload. Lines are joined with LF; trailing empty optional lines are omitted. reference (structured creditor reference) and remittance (unstructured text) are mutually exclusive.
static # Gs1(string ai, char ecc = 'M')BarcodeMatrixGS1 QR Code from bracketed AI syntax, e.g. "(01)09521234543213(3103)000123". EC level M.
static # Gs1RectMicroQr(string ai, string? version = default, char ecc = 'M')BarcodeMatrixGS1 rMQR (ISO/IEC 23941 with FNC1 in first position) from bracketed AI syntax; version null = smallest area.
static # SwissQr(string payload)SwissQrResultSwiss QR Code (QR-bill): payload as UTF-8, EC level M, plus the Swiss cross overlay.
StructuredAppendInfo Structured append parameters. StructuredAppendInfo.Index is 1-based. record6 members#
public record StructuredAppendInfo

Structured append parameters. StructuredAppendInfo.Index is 1-based.

Constructors

SignatureDescription
# StructuredAppendInfo(int Index, int Count, int Parity = -1, string? FileId = default)Structured append parameters. StructuredAppendInfo.Index is 1-based. Index: Position of this symbol in the sequence (1-based). · Count: Total number of symbols in the sequence. · Parity: QR parity byte (-1 = XOR of this symbol's data bytes); Data Matrix file id. · FileId: PDF417 macro file id (3-digit groups) / Aztec message ID (A–Z).

Properties

PropertyTypeDescription
Count { get; init; }intTotal number of symbols in the sequence.
FileId { get; init; }stringPDF417 macro file id (3-digit groups) / Aztec message ID (A–Z).
Index { get; init; }intPosition of this symbol in the sequence (1-based).
Parity { get; init; }intQR parity byte (-1 = XOR of this symbol's data bytes); Data Matrix file id.

Methods

Method SignatureReturnsDescription
# Deconstruct(out int Index, out int Count, out int Parity, out string FileId)void
SwissCross Overlay description of the Swiss cross printed in the centre of a Swiss QR Code (Swiss Payment Standards: 7 × 7 mm on a 46 × 46… record7 members#
public record SwissCross

Overlay description of the Swiss cross printed in the centre of a Swiss QR Code (Swiss Payment Standards: 7 × 7 mm on a 46 × 46 mm symbol). All values are fractions of the symbol side (quiet zone excluded) or of the cross side, matching BWIPP's drawing.

Constructors

SignatureDescription
# SwissCross(double SizeFraction, double SizeModules, double BlackInsetFraction, double ArmWidthFraction, double ArmLengthFraction)Overlay description of the Swiss cross printed in the centre of a Swiss QR Code (Swiss Payment Standards: 7 × 7 mm on a 46 × 46 mm symbol). All values are fractions of the symbol side (quiet zone excluded) or of the cross side, matching BWIPP's drawing. SizeFraction: Cross square side / symbol side (7/46), centred on the symbol. · SizeModules: Cross square side in modules. · BlackInsetFraction: White border around the black square, relative to cross side (6/83). · ArmWidthFraction: Width of the white cross arms, relative to cross side (15/83). · ArmLengthFraction: Tip-to-tip length of the white cross, relative to cross side (47/83).

Properties

PropertyTypeDescription
ArmLengthFraction { get; init; }doubleTip-to-tip length of the white cross, relative to cross side (47/83).
ArmWidthFraction { get; init; }doubleWidth of the white cross arms, relative to cross side (15/83).
BlackInsetFraction { get; init; }doubleWhite border around the black square, relative to cross side (6/83).
SizeFraction { get; init; }doubleCross square side / symbol side (7/46), centred on the symbol.
SizeModules { get; init; }doubleCross square side in modules.

Methods

Method SignatureReturnsDescription
# Deconstruct(out double SizeFraction, out double SizeModules, out double BlackInsetFraction, out double ArmWidthFraction, out double ArmLengthFraction)void
SwissQrResult Swiss QR Code result: plain QR modules (no cross, identical to bwip-js pixs) plus the cross overlay. record4 members#
public record SwissQrResult

Swiss QR Code result: plain QR modules (no cross, identical to bwip-js pixs) plus the cross overlay.

Constructors

SignatureDescription
# SwissQrResult(BarcodeMatrix Matrix, SwissCross Cross)Swiss QR Code result: plain QR modules (no cross, identical to bwip-js pixs) plus the cross overlay.

Properties

PropertyTypeDescription
Cross { get; init; }SwissCross
Matrix { get; init; }BarcodeMatrix

Methods

Method SignatureReturnsDescription
# Deconstruct(out BarcodeMatrix Matrix, out SwissCross Cross)void
Symbology All symbologies of the stand-alone barcode generator. enum144 members#
public enum Symbology

All symbologies of the stand-alone barcode generator.

Values

NameValueDescription
Code1280
Gs1_1281
Code392
Code39Extended3
Code934
Code115
Codabar6
Msi7
Plessey8
Telepen9
Pharmacode10
Ean1311
Ean812
UpcA13
UpcE14
EanUpcAddOn15
Interleaved2of516
Industrial2of517
Standard2of518
Logmars19
Leitcode20
Identcode21
Pzn22
Code3223
Isbn24
Issn25
Ismn26
Jan27
Vin28
HibcCode3929
HibcCode12830
Code93Extended31
Matrix2of532
Iata2of533
Datalogic2of534
Coop2of535
TelepenNumeric36
ChannelCode37
PharmacodeTwoTrack38
Sscc1839
Ean1440
Itf1441
Ean13Composite42
Ean8Composite43
UpcAComposite44
UpcEComposite45
Gs1_128Composite46
DataBarOmniComposite47
DataBarStackedComposite48
DataBarLimitedComposite49
DataBarExpandedComposite50
DataBarExpandedStackedComposite51
DataBarOmnidirectional52
DataBarTruncated53
DataBarStacked54
DataBarStackedOmnidirectional55
DataBarLimited56
DataBarExpanded57
DataBarExpandedStacked58
Postnet59
Planet60
IntelligentMail61
RoyalMail62
Kix63
AustraliaPost64
JapanPost65
Daft66
UspsFim67
Pdf417Compact68
MicroPdf41769
CodablockF70
Code16K71
Code4972
QrCode73
MicroQrCode74
RectMicroQrCode75
Gs1QrCode76
SwissQrCode77
EpcQrCode78
DataMatrix79
DataMatrixRectangular80
Gs1DataMatrix81
Pdf41782
Aztec83
AztecRune84
Gs1Aztec85
MaxiCode86
HanXin87
DotCode88
Ultracode89
SwissPostParcel90
UspsTrayLabel91
UspsSackLabel92
UspsImpb93
UspsPic94
FedExGround9695
VicsBol96
VicsScacPro97
ItalianPost2of598
DhlAwb99
Dun14Itf100
Jan8101
Ean99102
Numly103
Isbt128104
Isbt128DataMatrix105
HibcDataMatrix106
HibcQrCode107
HibcAztec108
HibcCodablockF109
HibcMicroPdf417110
IfaDataMatrix111
PpnDataMatrix112
VinQrCode113
VinDataMatrix114
Semacode115
MailmarkCmdm116
KoreaPost117
Mailmark4State118
Dpd119
UpuS10120
Flattermarken121
Bc412122
UpnQr123
GridMatrix124
CodeOne125
DataBarTruncatedComposite126
DataBarStackedOmniComposite127
EanVelocity128
DanishPostal39129
FrenchPostal39AR130
TriOptic131
Opc132
KodakPatch133
UspsHorizontalBars134
Imcb135
AusPostEParcel136
Scc14137
Gs1RectMicroQrCode138
DinSpecDataMatrix139
DinSpecQrCode140
JabCode141
Tlc39142
DeutschePostBzl143Deutsche Post BZL (UPU S10 identifier ending in DE as Code 128). Experimental: no Deutsche Post spec available.
Tlc39 TLC39 (Telecommunications Industry Bar Code, ANSI/TIA-1069 as implemented by ZPL ^BT): a Code 39 symbol carrying the 6-digit EC… class2 members#
public static class Tlc39

TLC39 (Telecommunications Industry Bar Code, ANSI/TIA-1069 as implemented by ZPL ^BT): a Code 39 symbol carrying the 6-digit ECI number with an optional linked MicroPDF417 (serial number and additional data) placed above it, left aligned. Data: "ECI" or "ECI,linked data" (same field data as ZPL ^BT).

Methods

Method SignatureReturnsDescription
static # Encode(string data, int wideRatio = 3, int linearHeight = 20, int gap = 2, int microRowHeight = 2, int microColumns = 0, int microRows = 0)BarcodeMatrixEncodes TLC39 as one module matrix: MicroPDF417 (each symbol row MicroPdf417.RowHeight modules high, microRowHeight overrides it), gap light module rows, then linearHeight module rows of Code 39 bars (wide = wideRatio modules, 2 or 3).
static # Split(string data)(string, string)Splits the ^BT field data into the ECI number and the linked MicroPDF417 data.
UpnQr UPNQR (Slovenian Univerzalni Plačilni Nalog): QR Code version 15 (77×77), EC level M, ECI 4 (ISO-8859-2), a single byte-mode se… class1 member#
public static class UpnQr

UPNQR (Slovenian Univerzalni Plačilni Nalog): QR Code version 15 (77×77), EC level M, ECI 4 (ISO-8859-2), a single byte-mode segment, mask chosen by zint's penalty evaluation.

Methods

Method SignatureReturnsDescription
static # Encode(string payload)BarcodeMatrixEncodes the UPN payload (Unicode text, must be representable in ISO-8859-2; at most 411 bytes).

ZplCore.Compliance #

18 types

Pre-check compliance engine, rule packs (GS1, Sunrise 2027, Amazon, UPS, FedEx, DHL, UDI), measured label model, and annotated compliance reports.

ComplianceBarcode A barcode with geometry measured on the rendered label. class19 members#
public sealed class ComplianceBarcode : ComplianceElement

A barcode with geometry measured on the rendered label.

Properties

PropertyTypeDescription
BarHeightDots { get; }intBar height in dots (linear codes: scan lines that cross the complete symbol); 0 for 2D.
BarHeightMm { get; }double
Data { get; }stringData as the scanner transmits it: Code 128 invocation codes resolved (FNC1 as GS U+001D, a leading FNC1 removed), QR / Data Matrix mode prefixes and escapes removed.
Gs1 { get; }Gs1ResultParsed and validated GS1 element strings when ComplianceBarcode.IsGs1 (null otherwise).
InterpretationAbove { get; }boolThe interpretation line is printed above the bars (^BC g = Y).
InterpretationBounds { get; }ComplianceRectArea of the printed interpretation line (empty when none was found).
InterpretationCharHeightDots { get; }intCharacter height of the interpretation line in dots (measured like ComplianceText.CharHeightDots).
InterpretationCharHeightMm { get; }double
InterpretationLine { get; }boolThe command asks for a printed interpretation line (e.g. ^BC f = Y, the default).
InterpretationText { get; }stringText the printer prints as interpretation line (data without invocation codes; ^BC mode D: the field data as written, without spaces).
Is2D { get; }boolTrue for matrix and stacked symbologies (QR, Data Matrix, Aztec, MaxiCode, PDF417 …).
IsGs1 { get; }boolThe symbol carries GS1 element strings (FNC1 in first position: GS1-128, GS1 DataMatrix, GS1 QR Code).
IsLinear { get; }boolTrue for single-row 1D symbologies (bars measured per scan line).
ModuleDots { get; }intNarrowest bar or space (linear) or module (2D) measured in dots; 0 when it could not be measured.
SymbolBounds { get; }ComplianceRectArea of the symbol itself in dots: for linear codes the bars (first to last bar, over the full-height scan lines, without interpretation line and quiet zones); for 2D codes the inked symbol area.
Symbology { get; }ComplianceSymbology
XDimensionMm { get; }doubleX-dimension in mm (ComplianceBarcode.ModuleDots at the label resolution).

Methods

Method SignatureReturnsDescription
# Ai(string ai)stringValue of the first GS1 element with this AI, or null.
# QuietZones(int dots)(ComplianceRect, ComplianceRect)Light areas before and after the symbol along the scan direction, each dots wide (left/right of the bars for N and I, above/below for R and B). Parts outside the label are kept, so callers can see them.
ComplianceElement One field of a rendered label as the compliance rules see it: what was drawn (ComplianceElement.Bounds in dots, from the render… class15 members#
public class ComplianceElement

One field of a rendered label as the compliance rules see it: what was drawn (ComplianceElement.Bounds in dots, from the renderer's element trace) and where it came from in the ZPL (ComplianceElement.Offset, ComplianceElement.Line).

Properties

PropertyTypeDescription
Arguments { get; }IReadOnlyList<string>Arguments of the element command (^BC → orientation, height, …), split at the delimiter.
Bounds { get; }ComplianceRectArea of the element on the label in dots (as traced by the renderer).
Column { get; }int
Command { get; }stringCommand that drew the element, with prefix: "^BC", "^A0", "^GB", "^FD" (text without ^A) …
Content { get; }stringField data after ^FH, ^FN, ^SN and ^FC processing (for shapes: their parameters).
FieldCommands { get; }IReadOnlyList<ZplCommand>All commands of the field block (^FO … ^FS) with their source offsets.
InkRects { get; }IReadOnlyList<ComplianceRect>Rectangles that actually carry ink: the four sides of an outlined ^GB box, otherwise ComplianceElement.Bounds (used for overlap checks, so a frame around a barcode does not count as overlapping it).
Kind { get; }ComplianceElementKind
Length { get; }intLength of the field's source block up to and including ^FS.
Line { get; }int
Offset { get; }intCharacter offset of the field's first command in the ZPL (-1 when unknown).
Orientation { get; }charN, R, I or B.
Reverse { get; }boolPrinted white on black (^FR / ^LR).

Methods

Method SignatureReturnsDescription
# Arg(int i)stringArgument i trimmed, or "" when omitted.
# ToString()string
ComplianceElementKind Kind of a rendered element. enum5 members#
public enum ComplianceElementKind

Kind of a rendered element.

Values

NameValueDescription
Text0
Barcode1
Shape2^GB, ^GC, ^GD, ^GE (boxes, lines, circles, ellipses).
Graphic3^GF, ^XG, ^IM and other images.
Other4
ComplianceFinding One result of a compliance pre-check. record15 members#
public record ComplianceFinding

One result of a compliance pre-check.

Constructors

SignatureDescription
# ComplianceFinding()

Properties

PropertyTypeDescription
Advisory { get; init; }boolTrue for recommendations and unverified values (see ComplianceRuleInfo.Advisory).
Bounds { get; init; }ComplianceRect?Area on the rendered label in dots (null for label-wide findings).
Column { get; init; }int1-based source column (0 when not applicable).
Command { get; init; }stringZPL command the finding refers to, e.g. "^BC" (empty for label-wide findings).
LabelIndex { get; init; }int0-based index of the rendered label (in print order) the finding belongs to; -1 for the whole input.
Length { get; init; }intLength of the field's source block (up to and including ^FS); 0 when not applicable.
Line { get; init; }int1-based source line (0 when not applicable).
required Message { get; init; }stringHuman-readable message (may change between versions; ComplianceFinding.RuleId is stable).
Offset { get; init; }intCharacter offset of the field (its first command, usually ^FO) in the ZPL source; -1 when not applicable.
required PackId { get; init; }stringId of the pack that ran the rule, e.g. "gs1-logistic".
required RuleId { get; init; }stringStable rule code, e.g. "ZPL3104".
required Severity { get; init; }ComplianceSeverity
Source { get; init; }stringCitation of the requirement.
Suggestion { get; init; }stringHow to fix it (optional).
ComplianceLabel One rendered label prepared for compliance rules: size, resolution, elements with measured geometry and the rendered ink, so ru… class22 members#
public sealed class ComplianceLabel

One rendered label prepared for compliance rules: size, resolution, elements with measured geometry and the rendered ink, so rules can look at what will actually print.

Properties

PropertyTypeDescription
Barcodes { get; }IEnumerable<ComplianceBarcode>
Bounds { get; }ComplianceRectThe whole label as rectangle.
Commands { get; }IReadOnlyList<ZplCommand>Commands of the label format (^XA … ^XZ) with source offsets.
Dpi { get; }int
Elements { get; }IReadOnlyList<ComplianceElement>Elements in drawing order.
HasLabelLength { get; }boolThe ZPL declares the length (^LL).
HasPrintWidth { get; }boolThe ZPL declares the width (^PW).
Height { get; }intLabel height in dots (^LL or the default size).
HeightMm { get; }double
Index { get; }int0-based index in print order.
RenderDiagnostics { get; }IReadOnlyList<ZplDiagnostic>Render diagnostics of this label (fields that could not be drawn etc.).
Rfid { get; }IReadOnlyList<ZplRfidCommand>RFID commands of the label in format order, with resolved field data (see ZplRfidCommand).
Source { get; }stringThe complete ZPL source that was checked.
Texts { get; }IEnumerable<ComplianceText>
Width { get; }intLabel width in dots (^PW or the default size).
WidthMm { get; }double

Methods

Method SignatureReturnsDescription
# InkBounds(ComplianceRect r)ComplianceRectTight bounds of the ink inside r (empty when there is none).
# InkCount(ComplianceRect r)intNumber of inked dots inside r (the part on the label).
# IsInk(int x, int y)boolInk at a dot (false outside the label).
# LastCommand(string name)stringCommand arguments of the last ^name in the format (e.g. "MD"), or null.
# ToDots(double mm)int
# ToMm(double dots)double
ComplianceOptions Settings of a compliance pre-check. class9 members#
public sealed class ComplianceOptions

Settings of a compliance pre-check.

Constructors

SignatureDescription
# ComplianceOptions()

Properties

PropertyTypeDescription
DefaultLabelHeightMm { get; set; }doubleLabel height in mm used when the ZPL has no ^LL (default 6 in = 152.4 mm).
DefaultLabelWidthMm { get; set; }doubleLabel width in mm used when the ZPL has no ^PW (default 4 in = 101.6 mm).
DisabledRules { get; }ISet<string>Rule ids that are not run (e.g. "ZPL3112").
Dpi { get; set; }intPrint resolution in dpi (ZPL does not carry it; default 203). All millimetre values (X-dimension, bar height, text size, label size) are computed with it, so set the resolution of the target printer.
FieldValues { get; set; }IReadOnlyDictionary<int, string>Values for ^FN fields (like ZplRenderSettings.FieldValues), e.g. to check a template with real data.
IncludeAdvisory { get; set; }boolReport advisory findings (recommendations, unverified values). Default true.
MinimumSeverity { get; set; }ComplianceSeverityFindings below this severity are dropped (default ComplianceSeverity.Info: keep all).
SeverityOverrides { get; }IDictionary<string, ComplianceSeverity>Per-rule severity overrides (rule id → severity).
CompliancePacks Built-in rule packs, combinable as flags (CompliancePacks.Gs1LogisticLabel | CompliancePacks.Sunrise2027). Every pack is a pre-… enum10 members#
public enum CompliancePacks

Built-in rule packs, combinable as flags (CompliancePacks.Gs1LogisticLabel | CompliancePacks.Sunrise2027). Every pack is a pre-check against public specifications; it does not certify a label (see ComplianceRulePack).

Values [Flags]

NameValueDescription
None0
Gs1LogisticLabel0x1GS1 logistic label (SSCC, GS1-128): GS1 General Specifications §5.4, §5.12.3.5, §6.6, GS1 Logistic Label Guideline.
Sunrise20270x2Sunrise 2027 / GS1 2D at retail: GTIN in GS1 DataMatrix or QR Code with GS1 Digital Link URI.
AmazonFba0x4Amazon FBA unit (FNSKU), box and pallet labels (Amazon Seller Central help pages).
Ups0x8UPS shipping labels: MaxiCode structured carrier message (modes 2/3), 1Z tracking number, 4 × 6 in.
Udi0x10Medical device UDI (FDA 21 CFR 801 / 830, EU MDR Annex VI) with GS1 AIs (01)(11)(17)(10)(21).
FedEx0x20FedEx basics from the public FedEx Ship API documentation (label sizes, PDF417, quiet zones).
DhlPaket0x40DHL Paket (Germany) basics from the public DHL Parcel DE Shipping API (label formats, 203 dpi, Leitcode/Identcode).
Rfid0x80RFID: EPC written by ^RF valid per GS1 EPC Tag Data Standard 2.3 and consistent with the printed GS1 keys, ^RF/^RB/^RS/^RL/^HV usage.
All0xFFAll built-in packs.
ComplianceRect Axis-aligned rectangle in printer dots (label coordinates, origin top left). struct14 members#
public readonly record struct ComplianceRect

Axis-aligned rectangle in printer dots (label coordinates, origin top left).

Constructors

SignatureDescription
# ComplianceRect(int X, int Y, int Width, int Height)Axis-aligned rectangle in printer dots (label coordinates, origin top left).

Properties

PropertyTypeDescription
Bottom { get; }int
Height { get; init; }int
IsEmpty { get; }bool
Right { get; }int
Width { get; init; }int
X { get; init; }int
Y { get; init; }int

Methods

Method SignatureReturnsDescription
# Contains(ComplianceRect o)boolTrue when o lies completely inside this rectangle.
# Deconstruct(out int X, out int Y, out int Width, out int Height)void
# Inflate(int dx, int dy)ComplianceRectGrown by dx left and right and dy top and bottom.
# Intersect(ComplianceRect o)ComplianceRectThe common area (empty when the rectangles do not intersect).
# Intersects(ComplianceRect o)boolTrue when both rectangles share at least one dot.
# Union(ComplianceRect o)ComplianceRectThe smallest rectangle containing both.
ComplianceReport Result of ZplCompliance.Check: findings plus JSON, SARIF and text output. class16 members#
public sealed class ComplianceReport

Result of ZplCompliance.Check: findings plus JSON, SARIF and text output.

Properties

PropertyTypeDescription
Dpi { get; }intResolution the millimetre values were computed with.
ErrorCount { get; }int
Findings { get; }IReadOnlyList<ComplianceFinding>All findings, ordered by label and source position.
HasErrors { get; }bool
InfoCount { get; }int
LabelCount { get; }intNumber of rendered labels.
Packs { get; }IReadOnlyList<ComplianceRulePack>The packs that were run.
Rules { get; }IReadOnlyList<(string, ComplianceRuleInfo)>The rules of all packs that were run plus the core rules (SARIF tool.driver.rules).
WarningCount { get; }int

Fields & Constants

FieldTypeDescription
const Disclaimer = "Pre-check against public specificati…"stringWording used in every output: this is a pre-check, not a certification.

Methods

Method SignatureReturnsDescription
# Fails(ComplianceSeverity failOn)boolTrue when a finding has at least severity failOn (for CI gates).
# ToJson(bool indented = true)stringFindings as JSON (tool, dpi, packs, summary, findings with bounds in dots and mm).
# ToSarif(string? artifactUri = default)stringSARIF 2.1.0 log (one run, all rules with citations, results with the ZPL line/column and the label area in properties) for GitHub code scanning and other SARIF viewers. artifactUri: Path of the checked file relative to the repository root (e.g. "labels/sscc.zpl").
# ToString()string
# ToText(string? fileName = default)stringPlain text: one line per finding and a summary line.
# WithFindings(IEnumerable<ComplianceFinding> findings)ComplianceReportA copy of this report with other findings (same packs, label count and dpi), e.g. filtered or with rewritten messages before ComplianceReport.ToSarif / ComplianceReport.ToJson.
ComplianceReporter Collects the findings of one rule on one label (passed to ComplianceRule.Check). class1 member#
public sealed class ComplianceReporter

Collects the findings of one rule on one label (passed to ComplianceRule.Check).

Methods

Method SignatureReturnsDescription
# Add(string message, ComplianceElement? element = default, ComplianceSeverity? severity = default, ComplianceRect? bounds = default, string? suggestion = default)voidReports a finding. With an element the finding gets its command, source position and bounds (unless bounds is given); without one it applies to the whole label. message: What is wrong, with the measured and the required value. · element: Element the finding refers to (null: label-wide). · severity: Overrides the rule's default severity. · bounds: Area on the label (default: the element's symbol or bounds). · suggestion: How to fix it.
ComplianceRule A compliance rule: checks one rendered ComplianceLabel and reports findings. Derive from it, or use ComplianceRule.Create with … class4 members#
public abstract class ComplianceRule

A compliance rule: checks one rendered ComplianceLabel and reports findings. Derive from it, or use ComplianceRule.Create with a delegate, to write custom rules; put them into a ComplianceRulePack.

Properties

PropertyTypeDescription
Info { get; }ComplianceRuleInfoStable id, title, citation and default severity.

Methods

Method SignatureReturnsDescription
# Check(ComplianceLabel label, ComplianceReporter report)voidChecks one label; report problems through report.
static # Create(ComplianceRuleInfo info, Action<ComplianceLabel, ComplianceReporter> check)ComplianceRuleA rule from a delegate.
# ToString()string
ComplianceRuleInfo Static description of a rule (stable ComplianceRuleInfo.Id, citation, default severity). record9 members#
public record ComplianceRuleInfo

Static description of a rule (stable ComplianceRuleInfo.Id, citation, default severity).

Constructors

SignatureDescription
# ComplianceRuleInfo(string Id, string Title, ComplianceSeverity DefaultSeverity, string Source, string Description, bool Advisory = false, string? HelpUri = default)Static description of a rule (stable ComplianceRuleInfo.Id, citation, default severity). Id: Stable code, e.g. "ZPL3101". Custom rules should use an own prefix (e.g. "ACME001"). · Title: Short name shown in reports. · DefaultSeverity: Severity of findings unless the rule reports another one or options override it. · Source: Citation of the requirement (document, release, section), e.g. "GS1 General Specifications 26.0 §5.4.4.2". · Description: What the rule checks and how (one or two sentences). · Advisory: True when the value is a recommendation ("should") or could not be verified from a primary source; such findings never claim a violation of a hard requirement. · HelpUri: Public URL of the source, if any.

Properties

PropertyTypeDescription
Advisory { get; init; }boolTrue when the value is a recommendation ("should") or could not be verified from a primary source; such findings never claim a violation of a hard requirement.
DefaultSeverity { get; init; }ComplianceSeveritySeverity of findings unless the rule reports another one or options override it.
Description { get; init; }stringWhat the rule checks and how (one or two sentences).
HelpUri { get; init; }stringPublic URL of the source, if any.
Id { get; init; }stringStable code, e.g. "ZPL3101". Custom rules should use an own prefix (e.g. "ACME001").
Source { get; init; }stringCitation of the requirement (document, release, section), e.g. "GS1 General Specifications 26.0 §5.4.4.2".
Title { get; init; }stringShort name shown in reports.

Methods

Method SignatureReturnsDescription
# Deconstruct(out string Id, out string Title, out ComplianceSeverity DefaultSeverity, out string Source, out string Description, out bool Advisory, out string HelpUri)void
ComplianceRulePack A versioned set of rules for one target (a standard, a carrier, a retailer). The built-in packs check public specifications as … class20 members#
public sealed class ComplianceRulePack

A versioned set of rules for one target (a standard, a carrier, a retailer). The built-in packs check public specifications as a pre-check: a clean result means no rule found a problem, not that a label is certified or will be accepted. Custom packs: new ComplianceRulePack("acme", "ACME labels", "2026-10", rules).

Constructors

SignatureDescription
# ComplianceRulePack(string id, string name, string version, IEnumerable<ComplianceRule> rules, string? description = default)

Properties

PropertyTypeDescription
static AmazonFba { get; }ComplianceRulePackAmazon FBA unit (FNSKU), box and pallet labels.
static BuiltIn { get; }IReadOnlyList<ComplianceRulePack>All built-in packs.
Description { get; }string
static DhlPaket { get; }ComplianceRulePackDHL Paket Germany basics (public Parcel DE Shipping API).
static FedEx { get; }ComplianceRulePackFedEx basics (public Ship API documentation).
static Gs1LogisticLabel { get; }ComplianceRulePackGS1 logistic label: SSCC in GS1-128, symbol specification table 5, HRI and label layout.
Id { get; }stringShort id used on the command line, e.g. "gs1-logistic".
Name { get; }string
static Rfid { get; }ComplianceRulePackRFID: EPC per GS1 TDS 2.3, EPC consistent with the printed barcodes, ZPL RFID command usage.
Rules { get; }IReadOnlyList<ComplianceRule>
static Sunrise2027 { get; }ComplianceRulePackSunrise 2027: GTIN in GS1 DataMatrix or QR Code / Data Matrix with GS1 Digital Link URI next to EAN/UPC.
static Udi { get; }ComplianceRulePackMedical device UDI with GS1 AIs (FDA 21 CFR 801/830, EU MDR Annex VI).
static Ups { get; }ComplianceRulePackUPS: MaxiCode structured carrier message, 1Z tracking number, 4 × 6 / 4 × 8 in.
Version { get; }stringState of the sources the rules follow, e.g. "2026-10".

Methods

Method SignatureReturnsDescription
static # Find(string id)ComplianceRulePackA built-in pack by id ("gs1-logistic", "sunrise", "amazon-fba", "ups", "udi", "fedex", "dhl-paket", "rfid"; also some aliases), or null.
static # From(CompliancePacks packs)IReadOnlyList<ComplianceRulePack>The built-in packs selected by packs.
# ToString()string
# With(params ComplianceRule[] rules)ComplianceRulePackThis pack plus rules.
# Without(params string[] ruleIds)ComplianceRulePackThis pack without the rules with these ids.
ComplianceSeverity Severity of a ComplianceFinding (maps to SARIF note, warning, error). enum3 members#
public enum ComplianceSeverity

Severity of a ComplianceFinding (maps to SARIF note, warning, error).

Values

NameValueDescription
Info0Advice or a value that could not be checked automatically.
Warning1Probably rejected or hard to scan; review the label.
Error2Violates a stated requirement of the rule's source ("shall"/"must").
ComplianceSymbology Barcode symbology of a ZPL barcode command. enum28 members#
public enum ComplianceSymbology

Barcode symbology of a ZPL barcode command.

Values

ComplianceText A text field with its measured character height. class3 members#
public sealed class ComplianceText : ComplianceElement

A text field with its measured character height.

Properties

PropertyTypeDescription
CharHeightDots { get; }intCharacter height measured on the rendered glyphs in dots: the 75th percentile of the heights of the glyph shapes (connected ink regions) in the field, which is the cap / digit height for digits and capitals and ignores dots, accents and punctuation. 0 when nothing was drawn.
CharHeightMm { get; }doubleComplianceText.CharHeightDots in mm at the label resolution.
FontHeightDots { get; }intFont height parameter in dots (^A h, else ^CF h; 0 when unknown).
CoreRules Rules every check runs (pack "core"). class4 members#
public static class CoreRules

Rules every check runs (pack "core").

Properties

PropertyTypeDescription
static All { get; }IReadOnlyList<ComplianceRuleInfo>All core rules.

Fields & Constants

FieldTypeDescription
static readonly NoLabelComplianceRuleInfoZPL3000: the input contains no printable label.
static readonly RenderProblemComplianceRuleInfoZPL3001: the renderer reported a field that could not be drawn (see DIAGNOSTICS.md).
static readonly RuleFailedComplianceRuleInfoZPL3002: a rule threw an exception (usually a bug in a custom rule).
ZplCompliance Label compliance as code: renders ZPL and checks the rendered labels against rule packs (GS1 logistic label, Sunrise 2027, Amaz… class7 members#
public static class ZplCompliance

Label compliance as code: renders ZPL and checks the rendered labels against rule packs (GS1 logistic label, Sunrise 2027, Amazon FBA, UPS, UDI or your own). Geometric rules use the rendered element geometry (bars, quiet zones, X-dimension in mm at ComplianceOptions.Dpi, bar height, interpretation line, text size, overlaps). This is a pre-check against public specifications. It does not certify a label and does not replace carrier or retailer certification or a barcode verifier (ISO/IEC 15416 / 15415 grading needs the printed label).

Fields & Constants

FieldTypeDescription
const CorePackId = "core"stringRule id of findings that are not tied to a pack ("core" pack).

Methods

Method SignatureReturnsDescription
static # Analyze(string zpl, ComplianceOptions? options = default)IReadOnlyList<ComplianceLabel>Renders the labels and returns the measured model the rules work on (elements, barcodes with X-dimension, bar height, interpretation line, text heights). Useful for custom tooling and for writing rules.
static # Check(string zpl, CompliancePacks packs, ComplianceOptions? options = default)ComplianceReportChecks zpl with the built-in packs selected by packs.
static # Check(string zpl, IEnumerable<ComplianceRulePack> packs, ComplianceOptions? options = default)ComplianceReportChecks zpl with the given packs (built-in or custom).
static # Check(byte[] zpl, IEnumerable<ComplianceRulePack> packs, ComplianceOptions? options = default)ComplianceReportChecks raw ZPL bytes, decoded like ZplRenderer.ProcessCommands: UTF-8 when the bytes are valid UTF-8 with non-ASCII characters, else like a printer (ZplTextEncoding, code page 850 or the one of the active ^CI).
static # RenderAnnotated(byte[] zpl, ComplianceReport report, ComplianceOptions? options = default)List<byte[]>Renders the labels as PNG with the findings of report drawn on top: a frame per finding (red error, orange warning, blue info) with its rule id.
static # RenderAnnotated(string zpl, ComplianceReport report, ComplianceOptions? options = default)List<byte[]>

ZplCore.Export #

14 types

Specialized raster and printer-language exporters (TIFF CCITT G3/G4/LZW, PCL, PCX, ESC/POS, EPL, Fingerprint).

EscPosNv ESC/POS non-volatile (NV) graphics: store a logo in the printer's flash once, then print it by key. Modern printers use GS ( L … class6 members#
public static class EscPosNv

ESC/POS non-volatile (NV) graphics: store a logo in the printer's flash once, then print it by key. Modern printers use GS ( L / GS 8 L (keyed NV graphics); older ones FS q / FS p (numbered NV bit images). Note: printers limit how often NV memory may be written — download logos once, not per receipt.

Methods

Method SignatureReturnsDescription
static # DefineBitImages(IReadOnlyList<SKBitmap> images)byte[]FS q: define NV bit images 1…n (legacy; replaces all previously stored images). Images are padded to multiples of 8 dots and sent column by column (MSB = top), as the command requires.
static # DefineGraphic(SKBitmap bitmap, string key = "G1")byte[]GS ( L fn 67: define a keyed monochrome raster NV graphic (GS 8 L for data > 64 KB). bitmap: Logo; converted to 1 bit. · key: Two printable ASCII characters (32–126), e.g. "LG".
static # DeleteAllGraphics()byte[]GS ( L fn 65: delete all NV graphics.
static # DeleteGraphic(string key = "G1")byte[]GS ( L fn 66: delete one NV graphic.
static # PrintBitImage(int number = 1, int mode = 0)byte[]FS p n m: print NV bit image number (1-based); mode 0 normal … 3 quadruple.
static # PrintGraphic(string key = "G1", int scaleX = 1, int scaleY = 1)byte[]GS ( L fn 69: print the NV graphic with the given key (scale 1 or 2 per axis).
HtmlLabelImageFormat Image embedded in HTML output. enum3 members#
public enum HtmlLabelImageFormat

Image embedded in HTML output.

Values

NameValueDescription
Png0
Gif1
Svg2Inline SVG with the label traced to vector rectangles.
LabelLanguageWriter Writes a Label in other printer languages. Items with a native equivalent become commands; everything else is rendered through … class6 members#
public static class LabelLanguageWriter

Writes a Label in other printer languages. Items with a native equivalent become commands; everything else is rendered through the ZPL renderer and sent as a graphic. EPL/Fingerprint strings may contain binary graphic data: send them encoded as Latin-1.

Methods

Method SignatureReturnsDescription
static # ToEpl(Label label, int dpi = 203)string
static # ToEpl<T>(Label label, IEnumerable<T> records, int dpi = 203, Func<T, int>? copies = default, string formName = "ZPLENG")stringEPL2 with data binding: the label is stored once as a form (FS…FE, one per page) whose bound, expression and counter fields are form variables (V00, V01 …); each record then recalls the form (FR) and sends only the values in a "?" data block. Counters advance per record and per copy. Variable items without an EPL equivalent are sent as graphics with each record. Records: objects (property paths) or dictionaries.
static # ToEscPos(Label label, int dpi = 203)byte[]
static # ToFingerprint(Label label, int dpi = 203)stringFingerprint (Direct Protocol). Coordinates use AN 7 (top-left anchor), y measured from the label's bottom edge.
static # ToFingerprint<T>(Label label, IEnumerable<T> records, int dpi = 203, Func<T, int>? copies = default)stringFingerprint with data binding: one complete label (per page) for every record, with bound, expression and counter values resolved; counters advance per record and per copy (otherwise copies use PF n).
static # ToPcl(Label label, int dpi = 203)byte[]
OutputEncoder Final output stage: post-processing (flip, paper orientation, scaling, transparent paper) and encoding of rendered labels with … class3 members#
public static class OutputEncoder

Final output stage: post-processing (flip, paper orientation, scaling, transparent paper) and encoding of rendered labels with all format options of ZplRenderSettings.

Methods

Method SignatureReturnsDescription
static # Encode(IReadOnlyList<SKBitmap> labels, ZplRenderSettings s)List<byte[]>Post-processes and encodes all labels per ZplRenderSettings.OutputFormat.
static # PostProcess(SKBitmap bitmap, ZplRenderSettings s)SKBitmapApplies ZplRenderSettings.Flip, ZplRenderSettings.PaperOrientation, ZplRenderSettings.ImageScaleX/ZplRenderSettings.ImageScaleY (image formats only) and ZplRenderSettings.TransparentBackground. Returns bitmap itself when nothing changes, otherwise a new bitmap owned by the caller.
static # Transform(SKBitmap src, ZplFlip flip, bool rotate90)SKBitmapMirrors and/or turns the bitmap 90° clockwise.
PclColorMode Raster data layout for PCL output. enum3 members#
public enum PclColorMode

Raster data layout for PCL output.

Values

NameValueDescription
Monochrome01 bit per pixel (black/white), works on every PCL 5 printer.
Grayscale18-bit indexed with a 256-entry gray palette (PCL 5c).
Color224-bit RGB, direct by pixel (PCL 5c).
PclCompression PCL raster compression method (ESC * b # M). enum3 members#
public enum PclCompression

PCL raster compression method (ESC * b # M).

Values

NameValueDescription
None0Mode 0: unencoded.
PackBits2Mode 2: TIFF PackBits per row.
DeltaRow3Mode 3: delta row against the previous row.
PclOptions Options for PclWriter. class5 members#
public sealed class PclOptions

Options for PclWriter.

Constructors

SignatureDescription
# PclOptions()

Properties

PropertyTypeDescription
ColorMode { get; set; }PclColorMode
Compression { get; set; }PclCompression
Dpi { get; set; }int
Threshold { get; set; }byteLuminance threshold for monochrome conversion.
PclWriter PCL 5 / 5c raster writer: one page per bitmap, framed by printer reset (ESC E). class1 member#
public static class PclWriter

PCL 5 / 5c raster writer: one page per bitmap, framed by printer reset (ESC E).

Methods

Method SignatureReturnsDescription
static # Write(IEnumerable<SKBitmap> pages, PclOptions? options = default)byte[]
RasterExport Converts a rendered label (black on white) to 1-bit raster formats and printer languages. class9 members#
public static class RasterExport

Converts a rendered label (black on white) to 1-bit raster formats and printer languages.

Methods

Method SignatureReturnsDescription
static # Epl(SKBitmap bitmap)byte[]EPL2 label printing the bitmap with GW (Latin-1 bytes, binary data with 0 = black).
static # EscPos(SKBitmap bitmap, bool cut = true)byte[]ESC @, GS v 0 raster image, feed and GS V cut.
static # Fingerprint(SKBitmap bitmap)byte[]Intermec Fingerprint / Direct Protocol: whole label as a PRBUF image, then PF.
static # Fingerprint(SKBitmap bitmap, bool disableRun)byte[]Fingerprint raster; disableRun omits the PF print statement (image only buffered).
static # Pcl(SKBitmap bitmap, PclOptions options)byte[]PCL raster with colour mode and compression options (see PclWriter).
static # Pcl(SKBitmap bitmap, int dpi = 300, bool compress = true)byte[]PCL5 raster graphics, one page per call.
static # Pcx(SKBitmap bitmap, int dpi = 203)byte[]1-bit monochrome PCX (version 5, RLE).
static # Tiff(IEnumerable<SKBitmap> pages, TiffOptions options)byte[]Multi-page TIFF with any compression and pixel format (see TiffWriter).
static # Tiff(IEnumerable<SKBitmap> pages, TiffCompression compression = TiffCompression.PackBits, int dpi = 203)byte[]Multi-page 1-bit TIFF (little endian, WhiteIsZero, one strip per page).
TiffCompression enum6 members#
public enum TiffCompression

Values

NameValueDescription
None1
CcittGroup33CCITT Group 3 (T.4, one-dimensional Modified Huffman); 1-bit only.
CcittGroup44CCITT Group 4 (T.6 MMR); 1-bit only, best for labels.
Lzw5
Deflate8zlib/Deflate (Adobe, tag value 8).
PackBits32773
TiffOptions Options for TiffWriter. class5 members#
public sealed class TiffOptions

Options for TiffWriter.

Constructors

SignatureDescription
# TiffOptions()

Properties

PropertyTypeDescription
Compression { get; set; }TiffCompression
Dpi { get; set; }intX/Y resolution written to the file (pixels per inch).
PixelFormat { get; set; }TiffPixelFormat
Threshold { get; set; }byteLuminance threshold for 1-bit conversion.
TiffPixelFormat Sample layout of TIFF pages. enum4 members#
public enum TiffPixelFormat

Sample layout of TIFF pages.

Values

NameValueDescription
BlackWhite101 bit per pixel, WhiteIsZero (the only format allowed with CCITT compression).
Gray818-bit grayscale, BlackIsZero.
Rgb2428-bit RGB.
Rgba3238-bit RGB plus unassociated alpha.
TiffWriter Baseline TIFF 6.0 writer (little endian, one strip per page, any number of pages) with None, CCITT G3 (T.4 1D), CCITT G4 (T.6),… class1 member#
public static class TiffWriter

Baseline TIFF 6.0 writer (little endian, one strip per page, any number of pages) with None, CCITT G3 (T.4 1D), CCITT G4 (T.6), LZW, Deflate and PackBits compression.

Methods

Method SignatureReturnsDescription
static # Write(IEnumerable<SKBitmap> pages, TiffOptions? options = default)byte[]
VectorExport EPS, SVG and HTML output of rendered labels. "Outline" output traces the 1-bit label into filled rectangles, so text,… class5 members#
public static class VectorExport

EPS, SVG and HTML output of rendered labels. "Outline" output traces the 1-bit label into filled rectangles, so text, barcodes and graphics become resolution-independent vector shapes (no fonts are embedded).

Methods

Method SignatureReturnsDescription
static # ToEps(SKBitmap bitmap, int dpi = 203, bool outlines = false, string? title = default)byte[]Encapsulated PostScript (EPSF-3.0) of one label in physical size. outlines = vector rectangles (text as outlines); otherwise a 1-bit image.
static # ToHtml(IEnumerable<SKBitmap> labels, int dpi = 203, HtmlLabelImageFormat format = HtmlLabelImageFormat.Png, string title = "Labels")stringHTML page showing all labels in physical size, each embedded as PNG/GIF data URI or inline SVG.
static # ToSvg(SKBitmap bitmap, int dpi = 203, SKColor? ink = default, SKColor? background = default)stringSVG of one label; physical size from dpi, vector rectangles in dot units.
static # ToSvgImage(SKBitmap bitmap, int dpi = 203)stringSVG of one label with the bitmap embedded as PNG (physical size from dpi).
static # TraceRectangles(SKBitmap bitmap, byte threshold = 128)List<SKRectI>Black areas of the label as rectangles (horizontal runs merged vertically), in dots.

ZplCore.Extraction #

31 types

Structured label field extraction (SSCC, tracking, GS1 AIs, addresses, PII) and rule-based ZPL redaction (ZplExtract, ZplRedact).

BarcodeRedaction What happens to barcodes whose data contains redacted information. enum2 members#
public enum BarcodeRedaction

What happens to barcodes whose data contains redacted information.

Values

NameValueDescription
Dummy0Same-length dummy data that keeps the symbology valid: character classes are kept, check digits of tracking numbers, SSCCs, GS1 keys and EAN/UPC are recomputed, MaxiCode / PDF417 carrier message structure stays intact.
Blank1The barcode field is removed from the label.
CarrierField One field of a structured carrier message. record5 members#
public record CarrierField

One field of a structured carrier message.

Constructors

SignatureDescription
# CarrierField(string Name, string Value, string? DataIdentifier = default)One field of a structured carrier message. Name: Field name (camelCase, e.g. "trackingNumber"), or "field{n}" when the position has no known name. · Value: Value as encoded. · DataIdentifier: ANSI MH10.8.2 data identifier for format 06 fields (e.g. "12Z").

Properties

PropertyTypeDescription
DataIdentifier { get; init; }stringANSI MH10.8.2 data identifier for format 06 fields (e.g. "12Z").
Name { get; init; }stringField name (camelCase, e.g. "trackingNumber"), or "field{n}" when the position has no known name.
Value { get; init; }stringValue as encoded.

Methods

Method SignatureReturnsDescription
# Deconstruct(out string Name, out string Value, out string DataIdentifier)void
CarrierMessage Structured carrier message (ISO/IEC 15434 envelope "[)>" RS … EOT) as used in MaxiCode (UPS) and PDF417 (FedEx): f… class6 members#
public sealed class CarrierMessage

Structured carrier message (ISO/IEC 15434 envelope "[)>" RS … EOT) as used in MaxiCode (UPS) and PDF417 (FedEx): format 01 transportation data (positional, field names per the Zebra ^BD documentation and ANSI MH10.8.3) and format 06 data identifier fields.

Constructors

SignatureDescription
# CarrierMessage()

Properties

PropertyTypeDescription
Fields { get; init; }IReadOnlyList<CarrierField>Fields of all formats in order.
required Format { get; init; }stringFormat header of the first format, "01" (transportation) or "06" (data identifiers).
this[string name] { get; }stringValue of the first field named name, or null.
Terminated { get; init; }boolThe message ends with RS EOT.
Version { get; init; }stringTwo-digit version after the format header ("96" for UPS, "02" for FedEx), null when absent.
DateOrder Order of day and month in numeric dates such as 03/04/2026. enum3 members#
public enum DateOrder

Order of day and month in numeric dates such as 03/04/2026.

Values

NameValueDescription
Auto0Month first when the label looks US (US address or USPS/UPS/FedEx US data), else day first; ambiguous dates are flagged.
DayMonthYear103/04/2026 is 3 April 2026.
MonthDayYear203/04/2026 is 4 March 2026.
DigitalLinkData A parsed GS1 Digital Link URI (uncompressed form). class6 members#
public sealed class DigitalLinkData

A parsed GS1 Digital Link URI (uncompressed form).

Constructors

SignatureDescription
# DigitalLinkData()

Properties

PropertyTypeDescription
Elements { get; init; }IReadOnlyList<Gs1ElementInfo>
Errors { get; init; }IReadOnlyList<string>Syntax violations (empty when valid).
IsValid { get; }bool
PrimaryKey { get; init; }stringAI of the primary key in the path (e.g. "01").
required Uri { get; init; }string
EntitySource Element an entity was found in. record6 members#
public record EntitySource

Element an entity was found in.

Constructors

SignatureDescription
# EntitySource(string ElementId, ExtractBox Bounds, int Start, int Length)Element an entity was found in. ElementId: Id of the text or barcode ("t3", "b1"). · Bounds: Box of that element. · Start: Start of the entity inside the element's text or data. · Length: Length inside the element's text or data.

Properties

PropertyTypeDescription
Bounds { get; init; }ExtractBoxBox of that element.
ElementId { get; init; }stringId of the text or barcode ("t3", "b1").
Length { get; init; }intLength inside the element's text or data.
Start { get; init; }intStart of the entity inside the element's text or data.

Methods

Method SignatureReturnsDescription
# Deconstruct(out string ElementId, out ExtractBox Bounds, out int Start, out int Length)void
EntityType Kind of a recognised entity. enum24 members#
public enum EntityType

Kind of a recognised entity.

Values

NameValueDescription
RecipientAddress0Address block of the recipient (ship to, Empfänger, destinataire …).
SenderAddress1Address block of the sender (from, Absender, expéditeur …).
ReturnAddress2Return address (return to, Rücksendung an, retour …).
Address3Address block whose role could not be told (no keyword, single block).
PersonName4A person's name (contact, attention line, name field).
Phone5
Email6
TrackingNumber7Carrier tracking number (UPS 1Z, FedEx, DHL, USPS IMpb, UPU S10 …).
Carrier8Carrier of the label (from tracking number formats, structured carrier messages and printed names).
Sscc9Serial Shipping Container Code (GS1 AI 00).
Gtin10Global Trade Item Number (GS1 AI 01/02, EAN/UPC).
Batch11Batch or lot number (GS1 AI 10, LOT, Charge …).
SerialNumber12Serial number (GS1 AI 21, S/N …).
ExpiryDate13Expiry / use-by date (GS1 AI 17, EXP …).
BestBeforeDate14Best-before date (GS1 AI 15, MHD …).
ProductionDate15Production date (GS1 AI 11).
PackagingDate16Packaging date (GS1 AI 13).
Date17Other date (ship date, Datum …).
Weight18Weight (kg, lb …; GS1 AI 310n/320n/330n/340n).
Amount19Money amount (declared value, COD).
PackageCount20Package n of m (1/1, 2 von 3 …).
OrderNumber21Order / purchase order number (Order, Bestellung, commande … ; GS1 AI 400).
Reference22Other reference: invoice, customer, account, shipment reference, company internal GS1 AIs 90–99.
RoutingCode23Postal routing data derived from the address: DHL Leitcode, GS1 AI 403/420/421, ZIP in POSTNET/IMb.
ExtractBox Axis-aligned box in printer dots with the same box in mm. record10 members#
public record ExtractBox

Axis-aligned box in printer dots with the same box in mm.

Constructors

SignatureDescription
# ExtractBox(int X, int Y, int Width, int Height, double XMm, double YMm, double WidthMm, double HeightMm)Axis-aligned box in printer dots with the same box in mm.

Properties

PropertyTypeDescription
Height { get; init; }int
HeightMm { get; init; }double
Width { get; init; }int
WidthMm { get; init; }double
X { get; init; }int
XMm { get; init; }double
Y { get; init; }int
YMm { get; init; }double

Methods

Method SignatureReturnsDescription
# Deconstruct(out int X, out int Y, out int Width, out int Height, out double XMm, out double YMm, out double WidthMm, out double HeightMm)void
ExtractOptions Settings of ZplExtract.Run. class7 members#
public sealed class ExtractOptions

Settings of ZplExtract.Run.

Constructors

SignatureDescription
# ExtractOptions()

Properties

PropertyTypeDescription
DateOrder { get; set; }DateOrderHow numeric dates like 03/04/2026 are read (default DateOrder.Auto).
DefaultLabelHeightMm { get; set; }doubleLabel height in mm used when the ZPL has no ^LL (default 6 in).
DefaultLabelWidthMm { get; set; }doubleLabel width in mm used when the ZPL has no ^PW (default 4 in).
Dpi { get; set; }intPrint resolution in dpi (ZPL does not carry it; default 203). Used for the millimetre values.
FieldValues { get; set; }IReadOnlyDictionary<int, string>Values for ^FN fields (like ZplRenderSettings.FieldValues).
MinimumConfidence { get; set; }doubleEntities below this confidence are dropped (default 0.3).
ExtractResult Result of ZplExtract.Run: one entry per rendered label. class8 members#
public sealed class ExtractResult

Result of ZplExtract.Run: one entry per rendered label.

Constructors

SignatureDescription
# ExtractResult()

Properties

PropertyTypeDescription
Dpi { get; init; }intResolution the millimetre values were computed with.
Label { get; }ExtractedLabelThe first label (null when the input prints none).
Labels { get; init; }IReadOnlyList<ExtractedLabel>
Notice { get; init; }stringReminder that the result is a rule-based guess.

Methods

Method SignatureReturnsDescription
static # FromJson(string json)ExtractResultParses JSON written by ExtractResult.ToJson.
# ToJson(bool indented = true)stringThe result as JSON (camelCase, enums as strings, nulls omitted; control characters escaped).
# ToText()stringHuman readable summary: entities per label, then texts and barcodes.
ExtractedBarcode A barcode with the data a scanner would read (encoder side, from the ZPL; not decoded from the image). class14 members#
public sealed class ExtractedBarcode

A barcode with the data a scanner would read (encoder side, from the ZPL; not decoded from the image).

Constructors

SignatureDescription
# ExtractedBarcode()

Properties

PropertyTypeDescription
required Bounds { get; init; }ExtractBox
CarrierMessage { get; init; }CarrierMessageStructured carrier message found in a PDF417 / Data Matrix / QR / Aztec symbol.
required Command { get; init; }stringBarcode command, e.g. "^BC".
required Data { get; init; }stringData as transmitted by a scanner: Code 128 invocation codes resolved (FNC1 as GS U+001D, a leading FNC1 removed), QR / Data Matrix mode prefixes and escapes removed. Control characters are kept (JSON escapes them).
FieldNumber { get; init; }int?
Gs1 { get; init; }Gs1Data
required Id { get; init; }stringId within the label ("b1", "b2" …).
IsGs1 { get; init; }boolFNC1 in first position (GS1-128, GS1 DataMatrix, GS1 QR).
MaxiCode { get; init; }MaxiCodeData
Orientation { get; init; }string
Source { get; init; }SourceSpan
Symbology { get; init; }ComplianceSymbology
ExtractedGraphic An image on the label. Its content is not inspected (text inside images is not extracted). class5 members#
public sealed class ExtractedGraphic

An image on the label. Its content is not inspected (text inside images is not extracted).

Constructors

SignatureDescription
# ExtractedGraphic()

Properties

PropertyTypeDescription
required Bounds { get; init; }ExtractBox
required Command { get; init; }string^GF, ^XG or ^IM.
required Id { get; init; }stringId within the label ("g1" …).
Source { get; init; }SourceSpan
ExtractedLabel Extraction result of one rendered label. class15 members#
public sealed class ExtractedLabel

Extraction result of one rendered label.

Constructors

SignatureDescription
# ExtractedLabel()

Properties

PropertyTypeDescription
Barcodes { get; init; }IReadOnlyList<ExtractedBarcode>
Entities { get; init; }IReadOnlyList<LabelEntity>Entities ordered by type, then position.
Graphics { get; init; }IReadOnlyList<ExtractedGraphic>
Height { get; init; }int
HeightMm { get; init; }double
Index { get; init; }int0-based index in print order.
Recipient { get; }LabelEntityThe recipient address block (or the only unassigned address block), or null.
Rfid { get; init; }IReadOnlyList<ExtractedRfid>
Sender { get; }LabelEntityThe sender address block, or null.
Texts { get; init; }IReadOnlyList<ExtractedText>
Width { get; init; }int
WidthMm { get; init; }double

Methods

Method SignatureReturnsDescription
# Best(EntityType type)LabelEntityThe most confident entity of one type, or null.
# OfType(EntityType type)IEnumerable<LabelEntity>Entities of one type.
ExtractedRfid Data written to an RFID tag (^RF write, ^WT …). class4 members#
public sealed class ExtractedRfid

Data written to an RFID tag (^RF write, ^WT …).

Constructors

SignatureDescription
# ExtractedRfid()

Properties

PropertyTypeDescription
required Command { get; init; }string
required Data { get; init; }stringData after ^FH decoding.
Source { get; init; }SourceSpan
ExtractedText A text field as drawn (all ^FH / ^CI / ^FN / ^XF / ^SN processing applied). class12 members#
public sealed class ExtractedText

A text field as drawn (all ^FH / ^CI / ^FN / ^XF / ^SN processing applied).

Constructors

SignatureDescription
# ExtractedText()

Properties

PropertyTypeDescription
required Bounds { get; init; }ExtractBoxBox of the printed text in dots: the inked extent along the reading direction, the line box across it.
FieldNumber { get; init; }int?^FN number when the field is variable.
Font { get; init; }stringFont as requested (0, A … or the ^A@ file name).
FontHeight { get; init; }intCharacter cell height in dots (^A / ^CF height, 0 = font default).
required Id { get; init; }stringId within the label ("t1", "t2" … in drawing order).
Orientation { get; init; }stringN, R, I or B.
Reverse { get; init; }boolWhite on black (^FR / ^LR).
Role { get; set; }TextRole
RoleConfidence { get; set; }doubleConfidence of ExtractedText.Role (0–1).
Source { get; init; }SourceSpan
required Text { get; init; }stringText as printed; ^FB line breaks (\&) become "\n".
Gs1Data Parsed GS1 element strings of a barcode or Digital Link URI. class4 members#
public sealed class Gs1Data

Parsed GS1 element strings of a barcode or Digital Link URI.

Constructors

SignatureDescription
# Gs1Data()

Properties

PropertyTypeDescription
Elements { get; init; }IReadOnlyList<Gs1ElementInfo>
Errors { get; init; }IReadOnlyList<string>Errors that are not tied to one element (unknown AI, missing separator …).
IsValid { get; init; }bool
Gs1ElementInfo One GS1 element string of a barcode. record8 members#
public record Gs1ElementInfo

One GS1 element string of a barcode.

Constructors

SignatureDescription
# Gs1ElementInfo(string Ai, string Title, string Value, bool Valid, string? Error = default, string? Interpreted = default)One GS1 element string of a barcode. Ai: Application identifier, e.g. "00". · Title: GS1 data title, e.g. "SSCC" (null for AIs without a known title). · Value: Value as encoded. · Valid: The value passes the GS1 syntax, length and check digit rules. · Error: Why it is invalid (null when valid). · Interpreted: Decoded value where the AI defines one: ISO date for YYMMDD, decimal value for n-decimal AIs.

Properties

PropertyTypeDescription
Ai { get; init; }stringApplication identifier, e.g. "00".
Error { get; init; }stringWhy it is invalid (null when valid).
Interpreted { get; init; }stringDecoded value where the AI defines one: ISO date for YYMMDD, decimal value for n-decimal AIs.
Title { get; init; }stringGS1 data title, e.g. "SSCC" (null for AIs without a known title).
Valid { get; init; }boolThe value passes the GS1 syntax, length and check digit rules.
Value { get; init; }stringValue as encoded.

Methods

Method SignatureReturnsDescription
# Deconstruct(out string Ai, out string Title, out string Value, out bool Valid, out string Error, out string Interpreted)void
LabelEntity A recognised piece of information with confidence, sources and evidence. class12 members#
public sealed class LabelEntity

A recognised piece of information with confidence, sources and evidence.

Constructors

SignatureDescription
# LabelEntity()

Properties

PropertyTypeDescription
Bounds { get; set; }ExtractBoxUnion of the source boxes.
Carrier { get; init; }stringCarrier id (ups, fedex, dhl, usps, royalmail …) for tracking numbers and carrier entities.
CheckDigitValid { get; init; }bool?Check digit result where the format has a public check digit (null: none or not verified).
Confidence { get; set; }doubleRule-based confidence 0–1 (not a probability).
required Evidence { get; set; }stringWhy the entity was recognised: keyword, pattern, GS1 AI, check digit, layout.
Normalized { get; init; }stringNormalised value: compact tracking number, ISO date, weight in kg/lb, E.164-like phone …
Properties { get; init; }SortedDictionary<string, string>Structured parts, e.g. address blocks: name, company, street, postalCode, city, state, country, countryCode, contact, phone, email; tracking numbers: service, format; dates: kind, ambiguous.
Sources { get; init; }List<EntitySource>
Type { get; init; }EntityType
required Value { get; init; }stringValue as printed or encoded (address blocks: the lines joined with "\n").

Methods

Method SignatureReturnsDescription
# ToString()string
MaxiCodeData MaxiCode content: mode, primary message (postal code, country, service class) and the carrier message. class7 members#
public sealed class MaxiCodeData

MaxiCode content: mode, primary message (postal code, country, service class) and the carrier message.

Constructors

SignatureDescription
# MaxiCodeData()

Properties

PropertyTypeDescription
Country { get; init; }stringISO 3166 alpha-2 of MaxiCodeData.CountryCode when known (e.g. "US").
CountryCode { get; init; }stringMode 2/3: ISO 3166 numeric country code (e.g. "840").
Message { get; init; }CarrierMessageSecondary message as structured carrier message, when present.
Mode { get; init; }intMaxiCode mode (2 = numeric postal code, 3 = alphanumeric, 4–6 = no structured primary message).
PostalCode { get; init; }stringMode 2/3: postal code of the ship-to address (mode 2: 5-digit ZIP + 4-digit ZIP+4).
ServiceClass { get; init; }stringMode 2/3: 3-digit class of service.
RedactCategories What ZplRedact removes, combinable as flags. enum14 members#
public enum RedactCategories

What ZplRedact removes, combinable as flags.

Values [Flags]

NameValueDescription
None0
Names0x1Person and company names: name lines of address blocks, contacts, attention lines, name fields.
Addresses0x2Street, building, postal code and city lines; postal routing data (Leitcode, GS1 AI 403/420/421, POSTNET/IMb ZIP, MaxiCode postal code).
Phone0x4
Email0x8
TrackingNumbers0x10Tracking numbers and SSCCs: they let anyone look up the shipment and its delivery address.
References0x20Order, invoice, customer, account and shipment reference numbers; GS1 AIs 400 and 90–99.
Comments0x40All ^FX comments and text outside of commands (the printer ignores it, but it travels with the file).
UnclassifiedText0x80Text and barcode data that is not recognised as a caption, carrier/service wording, date, weight, amount, package count or GS1 product data. This is what makes the default conservative: unknown free text is treated as personal.
Rfid0x100Data written to RFID tags (^RF, ^WT …).
Graphics0x200Images (^GF, ~DG, ~DY graphics): their content is not inspected, so they can only be blanked (same size, all white). Without this category every image is reported as not checked.
PersonalData0xFNames, addresses, phone numbers and e-mail addresses.
Default0x1FFThe default: personal data, tracking numbers, references, comments, unclassified text and RFID data (images are reported, not blanked).
All0x3FFEverything including images.
RedactMode How redacted text is written. enum3 members#
public enum RedactMode

How redacted text is written.

Values

NameValueDescription
Mask0Letters become X / x, digits 0; spaces and simple separators stay (same length, same layout).
Replace1Placeholder words of the same length per category (NAME, STREET, CITY …, digits 1234…).
Remove2The redacted text is deleted (fields stay, but print shorter or empty; barcodes are removed).
RedactOptions Settings of ZplRedact.Run. class8 members#
public sealed class RedactOptions

Settings of ZplRedact.Run.

Constructors

SignatureDescription
# RedactOptions()

Properties

PropertyTypeDescription
AdditionalTerms { get; }IList<string>Extra strings to redact wherever they appear (case, accents and spacing ignored), e.g. a customer name known to the caller. Matched like the recognised values (whole words, at least 3 letters or digits).
Barcodes { get; set; }BarcodeRedaction
Categories { get; set; }RedactCategoriesCategories to redact (default RedactCategories.Default, conservative).
Dpi { get; set; }intResolution used to render the label for the analysis (default 203).
KeepStructure { get; set; }boolKeep the length and character classes of redacted values (default true), so the label keeps its layout and barcodes keep their size. When false, redacted text becomes a fixed marker ("[REDACTED]" or "[NAME]" …) and barcodes with redacted data are removed.
Mode { get; set; }RedactMode
Verify { get; set; }boolRe-render and re-scan the output: every redacted value is searched again in all field data, comments, stored formats and decoded image data (default true). Remaining matches are masked in a second pass and reported.
RedactResult Result of ZplRedact.Run. class3 members#
public sealed class RedactResult

Result of ZplRedact.Run.

Constructors

SignatureDescription
# RedactResult()

Properties

PropertyTypeDescription
required Report { get; init; }RedactionReport
required Zpl { get; init; }stringThe redacted ZPL.
RedactionAction One redaction (never contains the original value). record11 members#
public record RedactionAction

One redaction (never contains the original value).

Constructors

SignatureDescription
# RedactionAction()

Properties

PropertyTypeDescription
Category { get; init; }RedactCategories
Characters { get; init; }intNumber of characters replaced or removed.
Column { get; init; }int
Command { get; init; }stringCommand that carried the data, e.g. "^FD", "^FX", "^BC".
Description { get; init; }string
Entity { get; init; }EntityType?Entity the redacted text belonged to (null for comments, unclassified text, images).
LabelIndex { get; init; }intLabel index (-1 when not tied to a rendered label).
Line { get; init; }int
Offset { get; init; }intOffset of the command in the original ZPL.
Target { get; init; }RedactionTarget
RedactionReport Redaction report: actions, warnings and the verification result (no original values). class13 members#
public sealed class RedactionReport

Redaction report: actions, warnings and the verification result (no original values).

Constructors

SignatureDescription
# RedactionReport()

Properties

PropertyTypeDescription
Actions { get; init; }IReadOnlyList<RedactionAction>
Categories { get; init; }RedactCategories
KeepStructure { get; init; }bool
LabelCount { get; init; }int
Mode { get; init; }RedactMode
RemainingMatches { get; init; }intRedacted values still found in the output after the second pass (0 is the expected result).
SearchedValues { get; init; }intNumber of distinct values that were searched for in the verification.
Summary { get; }IReadOnlyDictionary<string, int>Characters redacted per category ("FurtherOccurrences": values found again outside their field).
Verified { get; init; }boolThe output was re-scanned (RedactOptions.Verify).
Warnings { get; init; }IReadOnlyList<RedactionWarning>

Methods

Method SignatureReturnsDescription
# ToJson(bool indented = true)string
# ToText()string
RedactionTarget What was redacted. enum10 members#
public enum RedactionTarget

What was redacted.

Values

NameValueDescription
Text0A text field (^FD / ^FV).
Barcode1
Comment2A ^FX comment.
StrayText3Text outside of any command.
StoredFormat4A field default inside a stored format (^DF).
FieldNumberData5Field data of a ^XF recall (^FN n ^FD …).
Serial6A ^SN serialization start value.
Rfid7
Graphic8An image that was blanked.
Occurrence9A ^FN prompt or another occurrence found by the search for redacted values.
RedactionWarning Something the redaction could not handle or the caller should check. record8 members#
public record RedactionWarning

Something the redaction could not handle or the caller should check.

Constructors

SignatureDescription
# RedactionWarning(string Code, string Message, string Command = "", int Offset = -1, int Line = 0, int Column = 0)Something the redaction could not handle or the caller should check.

Properties

PropertyTypeDescription
Code { get; init; }string
Column { get; init; }int
Command { get; init; }string
Line { get; init; }int
Message { get; init; }string
Offset { get; init; }int

Methods

Method SignatureReturnsDescription
# Deconstruct(out string Code, out string Message, out string Command, out int Offset, out int Line, out int Column)void
SourceSpan Where an element comes from in the ZPL source. record6 members#
public record SourceSpan

Where an element comes from in the ZPL source.

Constructors

SignatureDescription
# SourceSpan(int Offset, int Length, int Line, int Column)Where an element comes from in the ZPL source. Offset: Character offset of the field's first command (-1 when unknown). · Length: Length of the field block up to and including ^FS. · Line: 1-based line (0 when unknown). · Column: 1-based column (0 when unknown).

Properties

PropertyTypeDescription
Column { get; init; }int1-based column (0 when unknown).
Length { get; init; }intLength of the field block up to and including ^FS.
Line { get; init; }int1-based line (0 when unknown).
Offset { get; init; }intCharacter offset of the field's first command (-1 when unknown).

Methods

Method SignatureReturnsDescription
# Deconstruct(out int Offset, out int Length, out int Line, out int Column)void
TextRole Role guess of a text field. enum20 members#
public enum TextRole

Role guess of a text field.

Values

NameValueDescription
Other0
Caption1Static caption or heading (SHIP TO, Gewicht:, TRACKING NUMBER …).
Name2Name line of an address block or contact.
Company3Company line of an address block.
AddressLine4Street, building, floor … of an address block.
PostalCity5Postal code and city.
Country6
Phone7
Email8
TrackingNumber9
Reference10Order, invoice, customer or other reference.
Date11
Weight12
Amount13
PackageCount14
BarcodeText15Human readable text of a barcode printed as separate field (same data).
Carrier16Carrier name or logo text.
Service17Service level (EXPRESS, GROUND, PRIORITY …).
Routing18Routing code (Leitcode, ZIP routing).
ProductData19Product data: GTIN, batch, serial, expiry.
ZplExtract Label understanding: turns ZPL into structured data per label — every text (with a role guess), every barcode with its data as … class2 members#
public static class ZplExtract

Label understanding: turns ZPL into structured data per label — every text (with a role guess), every barcode with its data as encoded (GS1 element strings with titles and validity, GS1 Digital Link, MaxiCode structured carrier message, ISO/IEC 15434 carrier messages) and recognised entities: sender / recipient / return address blocks, tracking numbers (UPS 1Z, FedEx, DHL, USPS IMpb, UPU S10 …, check digits where public), SSCC, GTIN, batch, expiry, serial, weights, dates, amounts, order and reference numbers, phone numbers and e-mail addresses. Assistive and rule-based: captions in English, German, French, Spanish, Italian, Polish, Dutch and Portuguese, layout and postal code patterns, public check digit algorithms. Deterministic, no machine learning, no network. Every entity carries a confidence, its source fields and the evidence; results are not guaranteed to be complete or correct. Text inside images is not read.

Methods

Method SignatureReturnsDescription
static # Run(string zpl, ExtractOptions? options = default)ExtractResultExtracts texts, barcodes and entities from every label the ZPL prints.
static # Run(byte[] zpl, ExtractOptions? options = default)ExtractResultExtracts from raw ZPL bytes (UTF-8 when valid, else code page 850, like the renderer).
ZplRedact Redaction of personal data in ZPL for support tickets, logs and sharing labels with vendors: names, addresses, phone numbers, e… class2 members#
public static class ZplRedact

Redaction of personal data in ZPL for support tickets, logs and sharing labels with vendors: names, addresses, phone numbers, e-mail addresses, tracking numbers, references, comments and unclassified text are replaced (same length and character classes, so the label keeps its layout), barcodes get same-length dummy data that keeps the symbology and check digits valid (or are removed), and the data is also removed where it hides outside the printed fields: ^FX comments, ^DF stored formats, ^FN defaults and prompts, ^XF field data, ^SN start values, ^RF RFID data, MaxiCode / PDF417 carrier messages and text outside of commands. Images cannot be inspected; they are reported or, with RedactCategories.Graphics, blanked. Assistive and rule-based (see ZplExtract): there is no guarantee that every piece of personal data is found. The default (RedactCategories.Default) is conservative and also redacts text it cannot classify. Review the output before sharing it. The report never contains the original values.

Methods

Method SignatureReturnsDescription
static # Run(string zpl, RedactOptions? options = default)RedactResultRedacts zpl; see RedactOptions for categories and modes.
static # Run(byte[] zpl, RedactOptions? options = default)RedactResultRedacts raw ZPL bytes (decoded like the renderer: UTF-8 when valid, else code page 850).

ZplCore.Graphics #

10 types

Monochrome bitmap processing, dithering (Floyd–Steinberg, Bayer, Atkinson, threshold), and ^GF / ~DG graphic compression (ACS, Z64, B64).

DitherMode Conversion of colour/gray images to 1 bit. enum5 members#
public enum DitherMode

Conversion of colour/gray images to 1 bit.

Values

NameValueDescription
Threshold0Fixed luminance threshold.
FloydSteinberg1
Atkinson2
Bayer3Ordered dithering with an 8×8 Bayer matrix.
Otsu4Threshold chosen automatically from the histogram (Otsu's method).
GifWriter Minimal GIF89a encoder (single frame, LZW). Images with at most 256 colours keep them exactly; others are reduced to a 3-3-2 RG… class1 member#
public static class GifWriter

Minimal GIF89a encoder (single frame, LZW). Images with at most 256 colours keep them exactly; others are reduced to a 3-3-2 RGB palette. Pixels with alpha < 128 become transparent.

Methods

Method SignatureReturnsDescription
static # Encode(SKBitmap bitmap)byte[]
GraphicCompression Data encoding of generated ^GF graphics. enum5 members#
public enum GraphicCompression

Data encoding of generated ^GF graphics.

Values

NameValueDescription
Hex0Plain ASCII hex (largest, every printer).
Acs1Zebra ASCII compression (run-length letters G–Y/g–z, ',', '!', ':').
Z642:Z64: zlib + base64 with CRC.
B643:B64: base64 with CRC.
Auto4Whichever of the above is shortest.
ImageMetadata Writes resolution (DPI) metadata into encoded PNG (pHYs chunk) and JPEG (JFIF APP0 density) files. class4 members#
public static class ImageMetadata

Writes resolution (DPI) metadata into encoded PNG (pHYs chunk) and JPEG (JFIF APP0 density) files.

Methods

Method SignatureReturnsDescription
static # GetJpegDpi(byte[] jpeg)(int, int)?Reads the JFIF density in DPI (units 1) or null.
static # GetPngDpi(byte[] png)(double, double)?Reads the pHYs resolution in DPI, or null.
static # SetJpegDpi(byte[] jpeg, double dpiX, double dpiY)byte[]Returns the JPEG with JFIF APP0 density set to the resolution in dots per inch (inserts APP0 if missing).
static # SetPngDpi(byte[] png, double dpiX, double dpiY)byte[]Returns the PNG with a pHYs chunk (replacing any existing one) for the given resolution.
MonoBitmap A stored 1-bit graphic (~DG, ~DY, ^GF) — 1 = black, MSB first. class7 members#
public sealed class MonoBitmap

A stored 1-bit graphic (~DG, ~DY, ^GF) — 1 = black, MSB first.

Constructors

SignatureDescription
# MonoBitmap(byte[] bits, int bytesPerRow, int height)

Properties

PropertyTypeDescription
Bits { get; }byte[]
BytesPerRow { get; }int
Height { get; }int
Width { get; }int

Methods

Method SignatureReturnsDescription
static # FromBitmap(SKBitmap source, byte threshold = 128, bool dither = false)MonoBitmapConverts any image to 1-bit using a luminance threshold (or Floyd–Steinberg dithering).
# ToGfa(bool compress = true)string^GFA command for this graphic (optionally Z64-compressed).
PcxDecoder Minimal PCX reader (RLE, 1 bpp monochrome or 8 bpp palette/grayscale) for EPL GM graphics. class1 member#
public static class PcxDecoder

Minimal PCX reader (RLE, 1 bpp monochrome or 8 bpp palette/grayscale) for EPL GM graphics.

Methods

Method SignatureReturnsDescription
static # Decode(byte[] pcx)MonoBitmapDecodes a PCX file to a 1-bit graphic (dark pixels = black).
PngCompression Compression/speed trade-off for PNG output. enum3 members#
public enum PngCompression

Compression/speed trade-off for PNG output.

Values

NameValueDescription
Fastest0zlib level 1 – fastest, ~2× larger files.
Optimal1zlib level 6 – good balance (default).
SmallestSize2zlib level 9 – smallest files, slowest.
PngWriter Fast PNG encoding for label images: grayscale (8 bit) for anti-aliased black-on-white output and true 1-bit PNGs for pure black… class2 members#
public static class PngWriter

Fast PNG encoding for label images: grayscale (8 bit) for anti-aliased black-on-white output and true 1-bit PNGs for pure black/white output, instead of 32-bit RGBA.

Methods

Method SignatureReturnsDescription
static # Grayscale(SKBitmap bitmap, PngCompression compression = PngCompression.Optimal)byte[]8-bit grayscale PNG via Skia (Sub filter — fastest for label content).
static # Monochrome(SKBitmap bitmap, PngCompression compression = PngCompression.Optimal)byte[]1-bit PNG (black = luminance < 128). For non-anti-aliased label images.
ZplGraphicDecoder Decodes ZPL graphic data (^GF, ~DG, ~DY) into a 1-bit-per-pixel byte array (MSB first, 1 = black). Supports ASCII hex incl. Zeb… class8 members#
public static class ZplGraphicDecoder

Decodes ZPL graphic data (^GF, ~DG, ~DY) into a 1-bit-per-pixel byte array (MSB first, 1 = black). Supports ASCII hex incl. Zebra run-length compression, :Z64: (zlib+base64), :B64: and raw binary.

Methods

Method SignatureReturnsDescription
static # Decode(string data, int bytesPerRow, int totalBytes)byte[]Decodes graphic data without a size limit (trusted input only).
static # Decode(string data, int bytesPerRow, int totalBytes, int maxBytes)byte[]Decodes graphic data. Never throws for malformed data (invalid base64/zlib yields an empty/zero-padded result). data: Field data: hex (optionally ZPL-compressed), :Z64: or :B64:. · bytesPerRow: Bytes per graphic row. · totalBytes: Total number of graphic bytes. · maxBytes: Upper bound for the decoded size (incl. totalBytes and zlib output); exceeding it throws InvalidDataException. 0 = unlimited.
static # DecodeAsciiHex(string data, int bytesPerRow, int totalBytes)byte[]ASCII hex with ZPL compression: G..Y = repeat 1..19, g..z = repeat 20..400 (step 20), ',' = rest of row 0, '!' = rest of row 1, ':' = repeat previous row. Counts apply to the following hex nibble.
static # DecodeAsciiHex(string data, int bytesPerRow, int totalBytes, int maxBytes)byte[]
static # DecodeBinary(string data, int totalBytes)byte[]Binary (format B) data as it appears in the ZPL string (Latin-1 chars → bytes).
static # DecodeBinary(string data, int totalBytes, int maxBytes)byte[]
static # EncodeAsciiHex(byte[] data)stringEncodes a 1bpp buffer as uncompressed ASCII hex (for ^GFA output).
static # EncodeZ64(byte[] data)stringEncodes a 1bpp buffer as :Z64: with CRC16 (CCITT, as used by Zebra).
ZplGraphicEncoder Image → ZPL graphic conversion with selectable dithering and ^GF data compression. class6 members#
public static class ZplGraphicEncoder

Image → ZPL graphic conversion with selectable dithering and ^GF data compression.

Methods

Method SignatureReturnsDescription
static # EncodeData(MonoBitmap mono, GraphicCompression compression)stringThe ^GF data field for a 1-bit graphic in the requested encoding.
static # ToDownloadGraphic(MonoBitmap mono, string name, bool acs = true)string~DG download (name like "R:LOGO.GRF") in ASCII hex / ACS so it can be recalled with ^XG.
static # ToGraphicField(MonoBitmap mono, GraphicCompression compression = GraphicCompression.Auto)string^GFA,total,total,bytesPerRow,data.
static # ToGraphicField(SKBitmap image, GraphicCompression compression = GraphicCompression.Auto, DitherMode dither = DitherMode.Threshold, byte threshold = 128)string^GFA graphic for an image.
static # ToMono(SKBitmap source, DitherMode dither = DitherMode.Threshold, byte threshold = 128)MonoBitmapConverts an image to 1 bit (transparent pixels are paper).
static # ToZpl(SKBitmap image, GraphicCompression compression = GraphicCompression.Auto, DitherMode dither = DitherMode.Threshold, int x = 0, int y = 0)stringComplete label ^XA^FOx,y^GFA…^FS^XZ printing the image.

ZplCore.Labels #

54 types

Declarative label object model (mm/inch/dots), expressions, tables, repeaters, multi-page duplex labels, bulk data binding (For<T>), print jobs, and ZPL import.

BarcodeItem class40 members#
public sealed class BarcodeItem : LabelItem

Constructors

SignatureDescription
# BarcodeItem()

Properties

PropertyTypeDescription
AddChecksum { get; set; }bool
BackColor { get; set; }stringBackground colour as hex (#RRGGBB); a dark background prints the code inverted.
BarHeight { get; set; }doubleBar height in label units (1D) or module size in dots (QR/DataMatrix/Aztec).
BearerBarWidth { get; set; }doubleBearer bar thickness in dots.
BearerBars { get; set; }BearerBarStyle
Code { get; set; }string
Code128Mode { get; set; }Code128ModeCode 128 mode (^BC m, native only; Symbology.Gs1_128 always uses mode D).
CodeEncoding { get; set; }CodeEncodingHow BarcodeItem.Code is interpreted (text, base64, hex).
DataBarSegments { get; set; }int?GS1 DataBar Expanded (Stacked) segments per row (null = 22 native / generator default).
FinderShape { get; set; }FinderShape
ForeColor { get; set; }stringBar colour as hex (#RRGGBB); dark colours print black, light ones white.
GuardBars { get; set; }boolExtend EAN/UPC guard bars into the text.
HumanReadable { get; set; }bool
HumanReadableAbove { get; set; }bool
HumanReadableText { get; set; }stringText instead of the encoded data.
IsGeneratorOnly { get; }boolSymbologies without a ZPL barcode command.
LightMarginIndicator { get; set; }boolEAN/UPC light margin indicators ('<' '>').
MaxiCodeMode { get; set; }intMaxiCode mode 2–6 (^BD).
ModuleShape { get; set; }ModuleShape
ModuleWidth { get; set; }intNarrow bar / module width in dots (^BY w).
Options { get; set; }BarcodeItemOptionsFurther generator render/symbology options (sizing, border, padding, Data Matrix size, Aztec layers …); any value set renders the item through the generator (^GFA).
Pdf417Columns { get; set; }intPDF417 data columns 1–30 (0 = automatic, ^B7 c).
Pdf417RowHeight { get; set; }intPDF417 row height in dots (^B7 h; 0 = 3 × BarcodeItem.ModuleWidth).
Pdf417Rows { get; set; }intPDF417 rows 3–90 (0 = automatic, ^B7 r; native only).
Pdf417SecurityLevel { get; set; }intPDF417 security level 0–8 (^B7 s).
ProcessTilde { get; set; }boolTilde escapes (~1 FNC1, ~dNNN …) in BarcodeItem.Code.
QrErrorCorrection { get; set; }charQR error correction: L, M, Q, H.
QrMask { get; set; }intQR mask 0–7 (-1 = automatic).
QrVersion { get; set; }intQR version 1–40 (0 = automatic).
QuietZone { get; set; }int?Quiet zone in modules on every side (null = none on labels).
Rotation { get; set; }ItemRotation
Supplement { get; set; }stringEAN/UPC 2/5-digit add-on.
Symbology { get; set; }Symbology
TextAlignment { get; set; }HumanReadableAlignment
TextFontSize { get; set; }doubleHuman readable font size in points (0 = automatic).
TextFormatPattern { get; set; }stringFormat/mask of the human readable text, e.g. "{0:### ###}" or "AAA-999".
WideRatio { get; set; }doubleWide-to-narrow ratio for Code 39, I2of5, Codabar ... (2.0–3.0).

Methods

Method SignatureReturnsDescription
static # ToGenerator(Symbology s)SymbologyGenerator symbology of a label symbology.
# ToZpl(ZplContext ctx)string
BarcodeItemOptions Barcode generator render and symbology options of a BarcodeItem (serialized with the label JSON). Null = generator default. Any… record62 members#
public record BarcodeItemOptions

Barcode generator render and symbology options of a BarcodeItem (serialized with the label JSON). Null = generator default. Any value set renders the item through the generator as a ^GFA graphic. Lengths (target size, padding, border) are in label units.

Constructors

SignatureDescription
# BarcodeItemOptions()

Properties

PropertyTypeDescription
Alignment { get; set; }BarcodeAlignment?
AztecErrorCorrection { get; set; }int?
AztecFormat { get; set; }AztecFormat?
AztecLayers { get; set; }int?
BarWidthReduction { get; set; }double?Bar width reduction in dots (ink spread compensation).
BarWidthReductionPercent { get; set; }double?
BorderColor { get; set; }stringBorder colour as hex (#RRGGBB).
BorderRadius { get; set; }double?
BorderWidth { get; set; }double?
ByteEncodingName { get; set; }string
CodabarStartChar { get; set; }char?
CodabarStopChar { get; set; }char?
Code128Subset { get; set; }Code128Subset?
Code16KMode { get; set; }Code16KMode?
Code16KRows { get; set; }int?
CodeFormatPattern { get; set; }string
CompositeComponent { get; set; }CompositeComponent?
DataMatrixDmre { get; set; }bool?
DataMatrixEncodation { get; set; }DataMatrixEncodation?
DataMatrixSize { get; set; }stringData Matrix size "RxC", e.g. "24x24" or "16x48".
DisplayChecksum { get; set; }bool?
DisplayStartStopChar { get; set; }bool?
DotCodeAspectRatio { get; set; }double?
DotCodeColumns { get; set; }int?
DotCodeRows { get; set; }int?
Gs1StrictValidation { get; set; }bool?
GuardBarHeight { get; set; }double?Guard bar extension in dots.
HanXinErrorCorrection { get; set; }int?
HanXinMode { get; set; }HanXinMode?
HanXinVersion { get; set; }int?
ItfHMarks { get; set; }bool?
MagnificationFactor { get; set; }double?
MaxiCodePixelAligned { get; set; }bool?
MicroPdf417Columns { get; set; }int?
MicroPdf417Rows { get; set; }int?
MicroQrVersion { get; set; }int?
MsiChecksum { get; set; }MsiChecksum?
PaddingBottom { get; set; }double?
PaddingLeft { get; set; }double?
PaddingRight { get; set; }double?
PaddingTop { get; set; }double?
Pdf417AspectRatio { get; set; }double?
Pdf417Compaction { get; set; }Pdf417Compaction?
PostalBarSpacing { get; set; }double?
PostalShortBarRatio { get; set; }double?
PostalTrackerRatio { get; set; }double?
QrEncodingMode { get; set; }QrEncodingMode?
RectMicroQrVersion { get; set; }string
RightToLeft { get; set; }bool?
Sizing { get; set; }BarcodeSizing?
SupplementSpacing { get; set; }int?
SupplementTopMargin { get; set; }double?Supplement top margin in dots.
TargetHeight { get; set; }double?
TargetWidth { get; set; }double?
TextPosition { get; set; }BarcodeTextPosition?Text placement (overrides BarcodeItem.HumanReadable/BarcodeItem.HumanReadableAbove).
TextStrikeout { get; set; }bool?
TextUnderline { get; set; }bool?
Tlc39Gap { get; set; }int?
Tlc39MicroPdfRowHeight { get; set; }int?
UltracodeErrorCorrection { get; set; }int?
UseQuietZoneForText { get; set; }bool?
CheckDigits Check digit helpers used by the expression engine (Mod10, Luhn, Mod11, Mod43, VoicePickCode). class5 members#
public static class CheckDigits

Check digit helpers used by the expression engine (Mod10, Luhn, Mod11, Mod43, VoicePickCode).

Methods

Method SignatureReturnsDescription
static # Luhn(string digits)stringLuhn (ISO/IEC 7812) check digit. Non-digits are ignored.
static # Mod10(string digits)stringGS1 / UPC modulo 10 check digit (weights 3,1,3,… from the right). Non-digits are ignored.
static # Mod11(string digits)stringModulo 11 check digit with weights 2..7 cycling from the right; remainder 0 → "0", 1 → "X".
static # Mod43(string data)stringCode 39 modulo 43 check character.
static # VoicePickCode(string gtin, string lot, string? date = default)stringProduce Traceability Initiative voice pick code: CRC-16 (polynomial 0x1021, initial value 0) over the ASCII text GTIN + lot (+ optional pack date YYMMDD); the four least significant decimal digits of the CRC.
CircleItem class6 members#
public sealed class CircleItem : LabelItem

Constructors

SignatureDescription
# CircleItem()

Properties

PropertyTypeDescription
Diameter { get; set; }double
Fill { get; set; }ItemColor
StrokeStyle { get; set; }StrokeStyle
StrokeThickness { get; set; }double

Methods

Method SignatureReturnsDescription
# ToZpl(ZplContext ctx)string
Code128Mode Code 128 mode of a native Symbology.Code128 item (^BC m parameter). enum4 members#
public enum Code128Mode

Code 128 mode of a native Symbology.Code128 item (^BC m parameter).

Values

NameValueDescription
Automatic0Automatic subset selection (^BC m = A, the default of the label model).
None1No mode (^BC m = N, the ZPL default): subsets and FNC codes come from invocation codes (>; >: >8 …) in the data.
Ucc2UCC case mode (^BC m = U): 19 digits padded and check digit added.
Gs13GS1-128 (^BC m = D), same as Symbology.Gs1_128.
CornerRadius class6 members#
public sealed class CornerRadius

Constructors

SignatureDescription
# CornerRadius()
# CornerRadius(double all)

Properties

PropertyTypeDescription
BottomLeft { get; set; }double
BottomRight { get; set; }double
TopLeft { get; set; }double
TopRight { get; set; }double
DitherMethod Conversion of grey levels to black/white. enum5 members#
public enum DitherMethod

Conversion of grey levels to black/white.

Values

NameValueDescription
Threshold0Fixed ImageItem.Threshold.
FloydSteinberg1
Atkinson2
Bayer3Ordered 8×8 Bayer matrix.
Otsu4Automatic threshold (Otsu's method).
DpiSource Where the import resolution came from. enum4 members#
public enum DpiSource

Where the import resolution came from.

Values

NameValueDescription
Options0ImportOptions.Dpi.
UnitCommand1^MU base resolution (^MUd,o,c).
LabelSize2Label width (^PW) or the extent of the fields.
Default3Nothing hints at a resolution: 203 dpi.
EllipseItem class7 members#
public sealed class EllipseItem : LabelItem

Constructors

SignatureDescription
# EllipseItem()

Properties

PropertyTypeDescription
Fill { get; set; }ItemColor
Height { get; set; }double
StrokeStyle { get; set; }StrokeStyle
StrokeThickness { get; set; }double
Width { get; set; }double

Methods

Method SignatureReturnsDescription
# ToZpl(ZplContext ctx)string
ExpressionEngine Small expression language for label items, e.g. Upper([Name]) + " / " + Format(Now(), "dd.MM.yyyy") or If([… class19 members#
public sealed class ExpressionEngine

Small expression language for label items, e.g. Upper([Name]) + " / " + Format(Now(), "dd.MM.yyyy") or If([Qty] > 10, "BULK", "SINGLE"). Fields: [Field Name] (data record), or item names ([TextItem1] = text of another item)Literals: numbers, "strings", true/falseOperators: + - * / % (+ concatenates if either side is text), = <> < <= > >=, and/or/not, unary -Variables: LABEL_INDEX, LABEL_NUMBER; in data bindings also LABEL_WIDTH, LABEL_HEIGHT (label units), RECORD_INDEX, PAGE_NUMBER and TOTAL_PAGES (when the record count is known); plus custom ones via ExpressionEngine.VariablesConversions use ExpressionEngine.Culture (invariant by default); Format/ToString/ToNumber accept a culture name argument.Functions: see ExpressionEngine.Functions; add your own.

Thread safety: ExpressionEngine.Evaluate may be called concurrently once configured (the member cache is static and concurrent); configuration (ExpressionEngine.Variables, ExpressionEngine.Functions, AddTypeReference) is not thread-safe.

Constructors

SignatureDescription
# ExpressionEngine()

Properties

PropertyTypeDescription
Clock { get; set; }Func<DateTime>Clock for Now()/Today() (tests, reprints with the original date).
Culture { get; set; }CultureInfoCulture used for number/date text conversion, Upper/Lower and Format. Defaults to CultureInfo.InvariantCulture so labels don't change with the server's regional settings.
Functions { get; }Dictionary<string, Func<object[], object>>
TypeReferences { get; }IReadOnlyDictionary<string, Type>Registered types (name → type) whose public static and instance members may be used, e.g. Math.Max(1, [Qty]).
Variables { get; }Dictionary<string, object>

Methods

Method SignatureReturnsDescription
# AddTypeReference<TRef>(string? alias = default)ExpressionEngine
# AddTypeReference(Type type, string? alias = default)ExpressionEngineAllows expressions to call public members of type: static members via the type name (Math.Max(1, [Qty]), DateTime.Now.AddDays(3)) and instance members on values of registered types. Only registered types are accessible.
static # Bool(object v)bool
# Evaluate(string expression, Func<string, object>? fieldResolver = default)object
# EvaluateToString(string expression, Func<string, object>? fieldResolver = default)stringEvaluates to a display string.
static # Num(object v)doubleCulture-invariant number conversion (use ExpressionEngine.ToNum for the engine's ExpressionEngine.Culture).
static # Num(object v, IFormatProvider culture)double
# SetCustomFunction(string name, Func<object[], object> function)ExpressionEngineAdds or replaces a function callable as Name(args).
# SetCustomVariable(string name, object value)ExpressionEngineAdds or replaces a variable usable by name in expressions.
static # Str(object v)stringCulture-invariant text conversion (use ExpressionEngine.ToText for the engine's ExpressionEngine.Culture).
static # Str(object v, IFormatProvider culture)string
# ToNum(object v)doubleConverts a value to a number with ExpressionEngine.Culture (falls back to invariant parsing).
# ToText(object v)stringConverts a value to text with ExpressionEngine.Culture.
FontUnit Unit of a font size (TextItem.FontSize). enum4 members#
public enum FontUnit

Unit of a font size (TextItem.FontSize).

Values

NameValueDescription
Point0
Pixel1Printer dots (pixels).
Millimeter2
Inch3
FrameThickness Per-corner radius of a rectangle (label units). class6 members#
public sealed class FrameThickness

Per-corner radius of a rectangle (label units).

Constructors

SignatureDescription
# FrameThickness()
# FrameThickness(double all)

Properties

PropertyTypeDescription
Bottom { get; set; }double
Left { get; set; }double
Right { get; set; }double
Top { get; set; }double
ITextMeasurer Unit conversion and data context for ZPL generation. interface1 member#
public interface ITextMeasurer

Unit conversion and data context for ZPL generation.

Methods

Method SignatureReturnsDescription
# Lines(string fontId, int height, int width, string text, int blockWidth)intNumber of lines the text needs in a block of the given width (dots).
ImageAspectRatio How an image keeps its aspect ratio when sized. enum4 members#
public enum ImageAspectRatio

How an image keeps its aspect ratio when sized.

Values

NameValueDescription
None0Missing dimension follows the aspect ratio; both given = stretched.
Width1Height follows ImageItem.Width.
Height2Width follows ImageItem.Height.
Fit3Largest size inside Width × Height.
ImageFlip enum4 members#
public enum ImageFlip

Values

NameValueDescription
None0
X1
Y2
XY3
ImageItem Image converted to a 1-bit ^GFA graphic (Z64 compressed) or stored on the printer (~DG + ^XG). class16 members#
public sealed class ImageItem : LabelItem

Image converted to a 1-bit ^GFA graphic (Z64 compressed) or stored on the printer (~DG + ^XG).

Constructors

SignatureDescription
# ImageItem()

Properties

PropertyTypeDescription
Dither { get; set; }boolLegacy: Floyd–Steinberg dithering (same as ImageItem.DitherMethod = FloydSteinberg).
DitherMethod { get; set; }DitherMethod
Flip { get; set; }ImageFlip
Height { get; set; }double?
HideIfNotFound { get; set; }boolEmit nothing (instead of throwing) when ImageItem.SourceFile doesn't exist.
ImageData { get; set; }byte[]PNG/JPEG/... bytes, stored as base64 in JSON.
LockAspectRatio { get; set; }ImageAspectRatio
ReverseEffect { get; set; }boolInvert the image (negative), independent of ^FR.
SourceDpi { get; set; }double?Resolution of the source pixels; with no Width/Height the image keeps its physical size (null = 1 px per dot).
SourceFile { get; set; }stringImage file loaded when generating (used when ImageItem.ImageData is empty).
StorageName { get; set; }stringPrinter name for ImageItem.UsePrinterStorage, e.g. "R:LOGO.GRF" (null = derived from the content).
Threshold { get; set; }byte
UsePrinterStorage { get; set; }boolDownload the graphic once (~DG) and reference it with ^XG instead of repeating ^GFA data.
Width { get; set; }double?Target size in label units; null keeps the pixel size (1 px = 1 dot) or follows the aspect ratio.

Methods

Method SignatureReturnsDescription
# ToZpl(ZplContext ctx)string
ImportFallback What Label.FromZpl does with a field the label model cannot express exactly. enum2 members#
public enum ImportFallback

What Label.FromZpl does with a field the label model cannot express exactly.

Values

NameValueDescription
RawZpl0Keep the field as an exact, self-contained RawZplItem (prints identically, not editable as a typed item).
Approximate1Use the closest typed item anyway (editable, may print slightly differently; reported as LabelImportWarningKind.Approximated).
ImportOptions Options of Label.FromZpl. class12 members#
public sealed class ImportOptions

Options of Label.FromZpl.

Constructors

SignatureDescription
# ImportOptions()

Properties

PropertyTypeDescription
CompareTolerance { get; set; }intPixel tolerance of the fidelity comparison (see ImageCompare.Compare; 0 = exact pixels).
DefaultHeight { get; set; }int?
DefaultWidth { get; set; }int?Label size used when a format has no ^PW / ^LL (dots; null = 4 × 6 in at the detected resolution).
DetectPlaceholders { get; set; }boolField data that is exactly ${NAME} or ${NAME:default} becomes a data binding to NAME with the default as text (the placeholder convention of zplCloud templates).
Dpi { get; set; }int?Printer resolution the ZPL was written for (null = detect from ^MU, label width and field extents; 203 when unknown).
Fallback { get; set; }ImportFallbackHandling of fields without an exact typed equivalent.
FontProvider { get; set; }Func<string, byte[]>Supplies ^A@ / ^CW fonts that are not downloaded in the ZPL (as in ZplRenderSettings.FontProvider).
IncludeImages { get; set; }boolKeep PNG renders of the original, the re-exported label and their diff in ImportedLabel.
MeasureFidelity { get; set; }boolRender the re-exported label and compare it with the original (fills ImportedLabel.Fidelity).
Unit { get; set; }LabelUnitUnit of the imported labels (positions and sizes). LabelUnit.Dots keeps the exact ZPL values.
UseSystemFonts { get; set; }boolUse installed system fonts for unknown ^A@ fonts (as in ZplRenderSettings.UseSystemFonts).
ImportedLabel One imported format. class17 members#
public sealed class ImportedLabel

One imported format.

Constructors

SignatureDescription
# ImportedLabel()

Properties

PropertyTypeDescription
Comparison { get; init; }ImageComparisonPixel comparison of the original render with the re-exported label.
Copies { get; init; }int^PQ quantity of the format.
DiffPng { get; init; }byte[]Diff PNG: black = both, red = only original, blue = only re-export (ImportOptions.IncludeImages).
Fidelity { get; }double?Round-trip score 0–1 (null when ImportOptions.MeasureFidelity is off).
FieldValues { get; init; }IReadOnlyDictionary<string, string>Data field values of this label (DataField → text), e.g. the ^XF data block; pass to Label.ToZpl(records).
FormatName { get; init; }stringName of the stored format this label defines (^DF) or recalls (^XF).
Index { get; init; }intIndex in LabelImportResult.Labels.
IsTemplate { get; init; }boolTrue for a stored format (^DF) imported as template; its unbound fields show their ^FN number as sample text.
required Label { get; init; }LabelThe editable label (unit ImportOptions.Unit). For ^XF formats the bound items hold this label's values as text.
OriginalPng { get; init; }byte[]PNG of the original render (ImportOptions.IncludeImages).
PixelExact { get; init; }boolTrue when the re-exported label renders pixel-identical to the original.
RawItems { get; init; }intItems kept as RawZplItem.
RoundTripPng { get; init; }byte[]PNG of the re-exported label (ImportOptions.IncludeImages).
SourceOffset { get; init; }intCharacter offset of the format in the source (-1 = unknown).
TypedItems { get; init; }intItems imported as typed items (text, barcode, shape, image, RFID).
Warnings { get; init; }IReadOnlyList<LabelImportWarning>Messages of this label.
ItemColor Monochrome colour of fills, backgrounds and text. enum3 members#
public enum ItemColor

Monochrome colour of fills, backgrounds and text.

Values

NameValueDescription
None0
Black1
White2
ItemPadding Spacing inside an item's box (label units). class6 members#
public sealed class ItemPadding

Spacing inside an item's box (label units).

Constructors

SignatureDescription
# ItemPadding()
# ItemPadding(double all)

Properties

PropertyTypeDescription
Bottom { get; set; }double
Left { get; set; }double
Right { get; set; }double
Top { get; set; }double
ItemRotation enum4 members#
public enum ItemRotation

Values

NameValueDescription
None0
Rotate9090
Rotate180180
Rotate270270
Label Label designer object model: describe a label with items in physical units, then generate ZPL (Label.ToZpl), render a preview t… class47 members#
public sealed class Label

Label designer object model: describe a label with items in physical units, then generate ZPL (Label.ToZpl), render a preview through the ZPL renderer (Label.Render) or save it as JSON. Rendering always goes through the generated ZPL, so the preview equals what the printer gets.

Constructors

SignatureDescription
# Label()
# Label(LabelUnit unit, double width, double height)

Properties

PropertyTypeDescription
Culture { get; set; }stringCulture used to resolve {t:key} placeholders (e.g. "de-DE"; null = current UI culture).
CutAfterPrinting { get; set; }boolCut after each label (^MMC).
Darkness { get; set; }int?0–30 (^MD relative darkness is -30..30, ~SD absolute 0..30).
DownloadFonts { get; set; }boolSend Label.Fonts to the printer (disable if they are already stored there).
Duplex { get; set; }boolDuplex label: pages are printed as front/back pairs. Convention for the generated ZPL: every side is its own consecutive ^XA…^XZ format — front (page 1 = Label.Items), then back (page 2 = Label.Pages[0]), then front/back of further pages. Each side starts with a ^FXDUPLEX FRONT / ^FXDUPLEX BACK comment; a missing back side is emitted as an empty format so the sequence keeps its parity. With several copies the pairs are repeated (front, back, front, back …) instead of using ^PQ, so a duplex printer receives them in order.
Expressions { get; }ExpressionEngineExpression engine for item expressions (add custom functions/variables here).
FontAsGraphicThreshold { get; set; }intFonts in Label.Fonts larger than this many bytes are not downloaded; text items using them are sent as ^GFA graphic instead (0 = always download).
Fonts { get; set; }Dictionary<string, byte[]>TrueType fonts used by this label (name like "ARIAL.TTF" → file bytes, base64 in JSON). They are downloaded to the printer with ~DY in the first format and used via TextItem.Font = "E:ARIAL.TTF", and also used for preview and LabelItem.PrintAsGraphic.
GapLength { get; set; }doubleGap between labels (media setting, emitted as ^LL/^MN only).
GraphicCompression { get; set; }GraphicCompression?With ZplOptimization.Aggressive: re-encode ^GFA graphic data in this encoding (null = keep).
Height { get; set; }double
Items { get; set; }List<LabelItem>
Optimization { get; set; }ZplOptimizationOptimisation applied to the generated ZPL (see ZplOptimizer). The printed result is identical.
PageCount { get; }int
Pages { get; set; }List<LabelPage>Additional pages after the first one (Label.Items = page 1), e.g. the back side for duplex printers. Each page becomes its own format in order.
PrintInverted { get; set; }boolRotate the whole label by 180° (^PO I).
PrintMirror { get; set; }boolMirror the label (^PM Y).
PrintSpeed { get; set; }int?Print speed in inches per second (^PR).
SchemaVersion { get; set; }intSchema version of the JSON template (1 = files written before the field existed, migrated on load). Always Label.CurrentSchemaVersion after loading.
Strings { get; set; }Dictionary<string, Dictionary<string, string>>Localizable strings: culture name ("" = fallback) → key → text. Item texts, expressions results and table cells may contain {t:key} placeholders, resolved for Label.Culture (or the binding's culture) with fallback to the parent culture ("de-CH" → "de"), then "", then the key itself.
Unit { get; set; }LabelUnit
Width { get; set; }double

Fields & Constants

FieldTypeDescription
const CurrentSchemaVersion = 3intVersion of the JSON template schema written by this library.

Methods

Method SignatureReturnsDescription
# Add(LabelItem item)Label
# AddFont(string name, byte[] ttf)Label
# AddFontFile(string path, string? name = default)Label
# AddPage(string? name = default)LabelPageAdds a page (page 2 = back side on duplex printers) and returns it.
# AddString(string culture, string key, string text)LabelAdds a localized string.
# Clone()Label
# ConvertToUnit(LabelUnit unit, int dpi = 203)LabelConverts the label size and every item without own LabelItem.Unit to unit.
# FontDownloadZpl(FontDownloadCommand command = FontDownloadCommand.DY)stringOnly the font download commands (~DY, or ~DU) for Label.Fonts, e.g. to install the fonts once and then print with Label.DownloadFonts = false. Fonts above Label.FontAsGraphicThreshold are left out.
# For<T>()LabelBinding<T>Starts a strongly typed, streaming data binding (EF Core / LINQ / any IEnumerable or IAsyncEnumerable).
static # FromJson(string json)LabelLoads a JSON template of any schema version (older versions are migrated).
static # FromZpl(string zpl, ImportOptions? options = default)LabelImportResultImports existing ZPL (legacy labels, BarTender/NiceLabel exports, carrier templates) into editable label models: one Label per printed format (^XA…^XZ), one per stored format (^DF) with ^FN fields bound as LabelItem.DataFields. Element positions and all resolved parameters (^CF, ^FW, ^BY, ^MU, ^LH, ^CI …) come from the zplCore renderer. Fields the model can express are imported as typed items (text, barcode, shapes, images) after checking pixel by pixel that they print identically; the rest is kept as exact RawZplItem (see ImportOptions.Fallback). The result reports a round-trip fidelity score (FromZpl(z).Label.ToZpl() rendered against the original) and warnings with source positions.
# Localize(string text, string? culture = default)stringReplaces {t:key} placeholders for culture (null = Label.Culture).
# Render(int dpi = 203, ZplOutputFormat format = ZplOutputFormat.Png, IEnumerable<IReadOnlyDictionary<string, object>>? records = default)List<byte[]>Renders the label(s) through the ZPL renderer. Returns one encoded image per label.
# RenderPdf(int dpi = 203)byte[]
# RenderPng(int dpi = 203)byte[]
# ToHtml(int dpi = 203, IEnumerable<IReadOnlyDictionary<string, object>>? records = default, string title = "Labels")stringHTML page with the rendered label(s) embedded as PNG (for previews, e-mails, web views).
# ToJson()string
# ToZpl(int dpi = 203, int copies = 1)stringGenerates ZPL for one label (no data binding).
# ToZpl(IEnumerable<IReadOnlyDictionary<string, object>> records, int dpi = 203, int copiesPerRecord = 1)stringOne label per dictionary record (keys = LabelItem.DataField names).
# ToZpl<T>(IEnumerable<T> data, int dpi = 203, int copiesPerRecord = 1)stringOne label per object; data fields are property paths like "Customer.Address.City".
# ToZplAt(int index, int dpi = 203)stringZPL of the unbound label as the index-th printed label (counters advanced).
# Validate(IReadOnlyDictionary<string, object>? record = default)List<string>Checks text items against TextItem.ValidationRegex/TextItem.InputMask/TextItem.MaxLength for one record.
LabelBinding<T> Strongly typed, streaming mass data binding of a Label to C# objects. Works with anything enumerable: lists, LINQ queries, EF C… class30 members#
public sealed class LabelBinding<T>

Strongly typed, streaming mass data binding of a Label to C# objects. Works with anything enumerable: lists, LINQ queries, EF Core IQueryable (sync) or AsAsyncEnumerable() (async), so millions of records never have to be in memory at once.

Thread safety: once configured, ToZpl/Generate/Render may be called from several threads concurrently (the label template is only read); configuration methods (Map, Copies, ...) are not thread-safe.

Methods

Method SignatureReturnsDescription
# Across(int columns, double gap = 0, double leftOffset = 0)LabelBinding<T>Multi-across media: places columns records side by side in one format (e.g. 3 labels per row on 100 mm wide liner), separated by gap (label units).
# Batches(IEnumerable<T> records, int labelsPerBatch = 500, int dpi = 203)IEnumerable<string>Groups the generated ZPL into batches of labelsPerBatch records (one network write each).
# Copies(Func<T, int> copies)LabelBinding<T>Number of printed copies per record (^PQ), e.g. o => o.Quantity.
# CountQueryableWith(Func<IQueryable<T>, int> counter)LabelBinding<T>Counts IQueryable sources before streaming, e.g. q => q.Count() (one extra COUNT query; the records themselves are enumerated only once).
# CutAfterLastLabel(bool cut = true)LabelBinding<T>Cut only after the last label of the job: all formats print in tear-off mode (^MMT), the last one in cutter mode (^MMC).
# Generate(IEnumerable<T> records, int dpi = 203)IEnumerable<string>Lazily yields ZPL: leading label, ^DF template, one format per record, trailing label.
# Generate(IEnumerable<T> records, int dpi, int? recordCount)IEnumerable<string>Like LabelBinding.Generate with an explicit record count (null = automatic).
# GenerateAsync(IAsyncEnumerable<T> records, int dpi = 203, CancellationToken ct = default)IAsyncEnumerable<string>
# GenerateAsync(IAsyncEnumerable<T> records, int dpi, int? recordCount, CancellationToken ct = default)IAsyncEnumerable<string>Async generation with a known record count (e.g. from a separate COUNT query) for the leading label and TOTAL_PAGES.
# Job(string name, Func<T, string>? key = default)LabelBinding<T>Name and key (e.g. tracking number) used for PrintJobInfo.
# Map(string field, Func<T, object> selector)LabelBinding<T>Binds a data field name (as used in LabelItem.DataField or [Name] in expressions) to a lambda.
# MapItem(string itemName, Func<T, object> selector)LabelBinding<T>Binds the item with the given LabelItem.Name to a lambda (sets its DataField to the name).
# PrintAsync(ZplPrinterClient printer, IAsyncEnumerable<T> records, int labelsPerBatch = 500, int dpi = 203, IProgress<int>? progress = default, CancellationToken ct = default)Task<int>Prints all records in batches over one connection per batch. Returns the number of records.
# PrintAsync(ZplPrinterClient printer, IEnumerable<T> records, int labelsPerBatch = 500, int dpi = 203, IProgress<int>? progress = default, CancellationToken ct = default)Task<int>
# PrintAsync(ZplPrinterClient printer, IAsyncEnumerable<T> records, int? recordCount, int labelsPerBatch = 500, int dpi = 203, IProgress<int>? progress = default, CancellationToken ct = default)Task<int>Prints an async source with a known record count (leading label, TOTAL_PAGES).
# Render(IEnumerable<T> records, int dpi = 203, ZplOutputFormat format = ZplOutputFormat.Png)IEnumerable<byte[]>Lazily renders one encoded image per printed label (preview, PDF archive, e-mail ...).
# RenderPdf(IEnumerable<T> records, int dpi = 203)byte[]All labels as one multi-page PDF.
# ToZpl(IEnumerable<T> records, int dpi = 203)stringGenerates ZPL for all records (fine for small/medium jobs; use the Write/Stream methods for big ones).
# UseStoredFormat(string name = "R:ZPLCORE.ZPL")LabelBinding<T>Stores the label once in printer memory (^DF) and sends only the variable field values per record (^XF/^FN). Cuts the data volume for large jobs by typically 80–95 %.
# WithCulture(string culture)LabelBinding<T>Culture for {t:key} placeholders of this job (overrides Label.Culture).
# WithLeadingLabel(Label label)LabelBinding<T>Label printed before the records (bound to PrintJobInfo: JobName, Created, RecordCount if known, …).
# WithRecordCount(int? count)LabelBinding<T>Known number of records for streamed sources (shown on the leading label as RecordCount and available as TOTAL_PAGES). Collections are counted automatically; an explicit count passed to Generate/Write overrides this.
# WithTrailingLabel(Label label)LabelBinding<T>Label printed after the records (bound to PrintJobInfo incl. RecordCount, LabelCount, FirstKey, LastKey).
# WriteZpl(IEnumerable<T> records, TextWriter writer, int dpi = 203)voidStreams ZPL for all records to a writer (file, network stream ...).
# WriteZplAsync(IAsyncEnumerable<T> records, TextWriter writer, int dpi = 203, CancellationToken ct = default)TaskStreams ZPL from an async source, e.g. EF Core query.AsAsyncEnumerable().
# WriteZplAsync(IAsyncEnumerable<T> records, TextWriter writer, int dpi, int? recordCount, CancellationToken ct = default)TaskStreams ZPL from an async source; recordCount (if known) is shown on the leading label and as TOTAL_PAGES.
# WriteZplAsync(IAsyncEnumerable<T> records, Stream stream, int dpi = 203, int? recordCount = default, CancellationToken ct = default)TaskWrites UTF-8 ZPL for an async source to a stream with asynchronous writes only (safe for ASP.NET Core Response.Body, which forbids synchronous IO).
# WriteZplAsync(IEnumerable<T> records, Stream stream, int dpi = 203, int? recordCount = default, CancellationToken ct = default)TaskWrites UTF-8 ZPL for a (sync) source to a stream with asynchronous writes only. The record count is taken from collections automatically.
# WriteZplAsync(IAsyncEnumerable<T> records, PipeWriter writer, int dpi = 203, int? recordCount = default, CancellationToken ct = default)TaskWrites UTF-8 ZPL to a PipeWriter (e.g. ASP.NET Core Response.BodyWriter).
# WriteZplAsync(IEnumerable<T> records, PipeWriter writer, int dpi = 203, int? recordCount = default, CancellationToken ct = default)TaskSync-source variant of the PipeWriter overload.
LabelImportResult Result of Label.FromZpl. class7 members#
public sealed class LabelImportResult

Result of Label.FromZpl.

Constructors

SignatureDescription
# LabelImportResult()

Properties

PropertyTypeDescription
Dpi { get; init; }intResolution used for the import (and for Label.ToZpl(dpi) to reproduce the original).
DpiSource { get; init; }DpiSource
Fidelity { get; }doubleLowest round-trip score of all labels (1 when nothing was measured).
Label { get; }LabelThe first imported label (an empty 4 × 6 in label when the ZPL contains no format).
required Labels { get; init; }IReadOnlyList<ImportedLabel>Printed formats in source order, then stored formats (^DF) as templates.
required Warnings { get; init; }IReadOnlyList<LabelImportWarning>All messages, ordered by source position.
LabelImportWarning A message of Label.FromZpl with its source position. record9 members#
public record LabelImportWarning

A message of Label.FromZpl with its source position.

Constructors

SignatureDescription
# LabelImportWarning(LabelImportWarningKind Kind, string Command, string Message, int Offset, int Line, int Column, int LabelIndex)A message of Label.FromZpl with its source position. Kind: Severity / category. · Command: ZPL command (e.g. "^TB"), empty for general messages. · Message: English description. · Offset: Character offset in the ZPL source (-1 = unknown). · Line: 1-based line (0 = unknown). · Column: 1-based column (0 = unknown). · LabelIndex: Index into LabelImportResult.Labels (-1 = whole document).

Properties

PropertyTypeDescription
Column { get; init; }int1-based column (0 = unknown).
Command { get; init; }stringZPL command (e.g. "^TB"), empty for general messages.
Kind { get; init; }LabelImportWarningKindSeverity / category.
LabelIndex { get; init; }intIndex into LabelImportResult.Labels (-1 = whole document).
Line { get; init; }int1-based line (0 = unknown).
Message { get; init; }stringEnglish description.
Offset { get; init; }intCharacter offset in the ZPL source (-1 = unknown).

Methods

Method SignatureReturnsDescription
# Deconstruct(out LabelImportWarningKind Kind, out string Command, out string Message, out int Offset, out int Line, out int Column, out int LabelIndex)void
LabelImportWarningKind Kind of an import message. enum5 members#
public enum LabelImportWarningKind

Kind of an import message.

Values

NameValueDescription
Info0Resolved into the model without loss (e.g. ^LH, ^FW, ^CF, ^BY, ^CI defaults applied to every item).
Ignored1Printer or media setting the label model does not hold (no effect on the printed image, e.g. ^MN, ^MD).
KeptAsRawZpl2Field kept as exact raw ZPL because no typed item prints identically.
Approximated3Typed item that prints slightly differently or loses a printer-side behaviour.
Unsupported4Command that could not be imported and may change the printout.
LabelItem Base class for all label items. Positions are in the label's unit (or LabelItem.Unit). class14 members#
public abstract class LabelItem

Base class for all label items. Positions are in the label's unit (or LabelItem.Unit).

Properties

PropertyTypeDescription
DataField { get; set; }stringData binding: field name in the record passed to Label.ToZpl.
DataFieldFormat { get; set; }string.NET format string applied to the bound value, e.g. "0000" or "dd.MM.yyyy".
Expression { get; set; }stringExpression that computes the item's text/code, e.g. Upper([Name]) + " " + Format(Today(), "dd.MM.yy"). Takes precedence over LabelItem.DataField. See ExpressionEngine.
Name { get; set; }string
PrintAsGraphic { get; set; }boolRender the item to a bitmap and send it as ^GFA graphic (any TTF font, exact preview match, works on printers without the font or element support).
Reverse { get; set; }boolInvert the item over what's below it (^FR).
RotationAngle { get; set; }doubleRotation in degrees clockwise (any angle; 0 = use the item's Rotation if it has one). Multiples of 90° use native ZPL orientation where the item supports it; other angles render the item as ^GFA graphic. The rotated item's bounding box starts at (LabelItem.X, LabelItem.Y).
Unit { get; set; }LabelUnit?Unit of this item's position and sizes (null = the label's unit).
Visible { get; set; }bool
X { get; set; }double
Y { get; set; }double

Methods

Method SignatureReturnsDescription
# Clone()LabelItemDeep copy (through the JSON model).
# ConvertToUnit(LabelUnit unit, LabelUnit labelUnit = LabelUnit.Mm, int dpi = 203)LabelItemConverts position and sizes to unit and sets LabelItem.Unit. labelUnit is the unit used while LabelItem.Unit is null; dpi matters for dots only.
# ToZpl(ZplContext ctx)string
LabelPage One page of a multi-page (e.g. duplex front/back) label. class4 members#
public sealed class LabelPage

One page of a multi-page (e.g. duplex front/back) label.

Constructors

SignatureDescription
# LabelPage()

Properties

PropertyTypeDescription
Items { get; set; }List<LabelItem>
Name { get; set; }string

Methods

Method SignatureReturnsDescription
# Add(LabelItem item)LabelPage
LabelSchema Migrations of the label JSON template between schema versions. Version 1 = templates without "schemaVersion"; version… class1 member#
public static class LabelSchema

Migrations of the label JSON template between schema versions. Version 1 = templates without "schemaVersion"; version 2 adds text sizing modes and dither methods; version 3 adds duplex, localized strings/culture, ZPL optimisation, per-side text frames, table corner rounding, counter/mask options.

Methods

Method SignatureReturnsDescription
static # Migrate(JsonObject label)intUpgrades a label JSON object in place to Label.CurrentSchemaVersion; returns the original version.
LabelSheet Sheet of labels (e.g. A4 office label sheets or wide multi-across media). Each label is rendered through the ZPL renderer and p… class25 members#
public sealed class LabelSheet

Sheet of labels (e.g. A4 office label sheets or wide multi-across media). Each label is rendered through the ZPL renderer and placed on the page as a raster image (LabelSheet.ToPdf, LabelSheet.ToPng), or sent to a wide-media label printer side by side (LabelSheet.ToZpl`). Sizes are in LabelSheet.Unit; the label size comes from the LabelSheet.Label.

Constructors

SignatureDescription
# LabelSheet()

Properties

PropertyTypeDescription
Columns { get; set; }int
HorizontalGap { get; set; }double
Label { get; set; }LabelOptional label stored with the sheet (used by the overloads without a label argument).
LabelsPerSheet { get; }int
MarginLeft { get; set; }double
MarginTop { get; set; }double
Order { get; set; }LabelSheetOrder
PageHeight { get; set; }double
PageWidth { get; set; }double
Rows { get; set; }int
StartPosition { get; set; }int1-based position of the first label on the first sheet (reuse partially used sheets).
Unit { get; set; }LabelUnit
VerticalGap { get; set; }double

Methods

Method SignatureReturnsDescription
# CellPosition(int slot, Label label)(double, double)Top-left of the cell slot (0-based, on one sheet) in sheet units.
static # FromJson(string json)LabelSheet
# ToJson()string
# ToPdf(int dpi = 203, int count = 0)byte[]
# ToPdf<T>(Label label, IEnumerable<T> records, int dpi = 203)byte[]All sheets as one PDF (raster labels placed on page-sized pages).
# ToPdf(Label label, int dpi = 203, int count = 0)byte[]
# ToPng(int dpi = 203, int count = 0)List<byte[]>
# ToPng<T>(Label label, IEnumerable<T> records, int dpi = 203)List<byte[]>Sheets as PNG pages for the label's records.
# ToPng(Label label, int dpi = 203, int count = 0)List<byte[]>Sheets as PNG pages; count unbound labels (0 = fill the first sheet), counters advance.
# ToZpl<T>(Label label, IEnumerable<T> records, int dpi = 203)stringZPL for wide (multi-across) media: LabelSheet.Columns labels side by side per format, using LabelBinding.Across with LabelSheet.HorizontalGap and LabelSheet.MarginLeft. Requires row-wise order and LabelSheet.StartPosition 1 (a label printer can't skip used positions).
# ToZpl(Label label, int dpi = 203, int count = 0)stringWide media ZPL for unbound labels: one row of LabelSheet.Columns labels per format.
LabelSheetOrder enum2 members#
public enum LabelSheetOrder

Values

NameValueDescription
RowWise0Left to right, then next row.
ColumnWise1Top to bottom, then next column.
LabelUnit enum5 members#
public enum LabelUnit

Values

NameValueDescription
Mm0
Cm1
Inch2
Point3
Dots4
LineItem class7 members#
public sealed class LineItem : LabelItem

Constructors

SignatureDescription
# LineItem()

Properties

PropertyTypeDescription
StrokeStyle { get; set; }StrokeStyle
StrokeThickness { get; set; }double
White { get; set; }boolWhite line (erases).
X2 { get; set; }double
Y2 { get; set; }double

Methods

Method SignatureReturnsDescription
# ToZpl(ZplContext ctx)string
MaskCounter Mask counters such as "AA-0000" or "####-??": #/0 digit, A letter A–Z, a letter a–z, ? alphanumeric 0–9A–Z,… class2 members#
public static class MaskCounter

Mask counters such as "AA-0000" or "####-??": #/0 digit, A letter A–Z, a letter a–z, ? alphanumeric 0–9A–Z, everything else literal. The counting positions form one mixed-radix number, so increments carry across letter/digit positions and wrap around.

Methods

Method SignatureReturnsDescription
static # Apply(string value, string mask, string increment, long times)stringFormats value to the mask and advances it times × increment. Increment: signed number ("+1", "-2") applied at the last position, or a per-position pattern ("0010", "01-0000") aligned right to the counting positions (carry applies).
static # IsCounting(string increment)boolTrue when the increment changes the value.
PrintJobInfo Data of a print job for leading/trailing labels (bind fields like "JobName", "RecordCount", "FirstKey&… record8 members#
public record PrintJobInfo

Data of a print job for leading/trailing labels (bind fields like "JobName", "RecordCount", "FirstKey").

Constructors

SignatureDescription
# PrintJobInfo(string JobName, DateTime Created)Data of a print job for leading/trailing labels (bind fields like "JobName", "RecordCount", "FirstKey").

Properties

PropertyTypeDescription
Created { get; init; }DateTime
FirstKey { get; }string
JobName { get; init; }string
LabelCount { get; }intPrinted labels incl. copies (complete in the trailing label).
LastKey { get; }string
RecordCount { get; init; }int?Number of records (known up front for collections; for the trailing label always set).

Methods

Method SignatureReturnsDescription
# Deconstruct(out string JobName, out DateTime Created)void
PrintJobTemplate A complete print job as JSON template: optional leading label, the record label and an optional trailing label, plus job option… class15 members#
public sealed class PrintJobTemplate

A complete print job as JSON template: optional leading label, the record label and an optional trailing label, plus job options. Load it from one JSON file or from three separate label templates; it always produces ONE job (one ZPL stream / file).

Constructors

SignatureDescription
# PrintJobTemplate()

Properties

PropertyTypeDescription
CopiesField { get; set; }stringRecord member holding the number of copies per record (property path), e.g. "Parcels".
CutAfterLastLabel { get; set; }boolCut only after the last label (tear-off mode before).
JobName { get; set; }string
KeyField { get; set; }stringRecord member used as key for PrintJobInfo.FirstKey/PrintJobInfo.LastKey (property path).
Label { get; set; }LabelThe label printed for every record.
Leading { get; set; }LabelPrinted first; bound to PrintJobInfo.
StoredFormatName { get; set; }stringStore the record label once in printer memory (^DF/^XF) and send only field values.
Trailing { get; set; }LabelPrinted last; bound to PrintJobInfo (counts, first/last key).

Methods

Method SignatureReturnsDescription
# For<T>()LabelBinding<T>Creates the configured data binding for records of type T.
static # FromFiles(string leadingFile, string labelFile, string trailingFile)PrintJobTemplateLoads three label template files into one job (pass null for missing leading/trailing files).
static # FromJson(string json)PrintJobTemplate
static # FromLabels(string labelJson, string? leadingJson = default, string? trailingJson = default)PrintJobTemplateBuilds a job from three separate label templates (leading and trailing are optional).
# SaveFiles(string leadingFile, string labelFile, string trailingFile)voidWrites the three labels as separate template files (leading/trailing only if present).
# ToJson()stringWhole job (all three labels + options) as one JSON document.
PropertyPath Fast, cached access to (nested) members by name: "Name", "Customer.Address.City", "Items[0].Name"… class2 members#
public static class PropertyPath

Fast, cached access to (nested) members by name: "Name", "Customer.Address.City", "Items[0].Name", "[2]". Works on POCOs (compiled getters), IDictionary/IReadOnlyDictionary with string keys (incl. ExpandoObject), non-generic IDictionary, DataRow, System.Text.Json JsonElement and JsonNode/JsonObject/JsonArray, and string indexers. Keys are matched exactly first, then case-insensitively. JSON scalars are returned as CLR values (string, long, decimal/double, bool, null).

Thread-safe: the getter and path caches are concurrent dictionaries (bounded by the number of type/path pairs used). PropertyPath.RegisterUnwrapper` should be called at start-up. Under NativeAOT a POCO member that cannot be found throws MissingMemberException instead of returning null: its reflection metadata was probably trimmed (keep the model with TrimmerRootAssembly; docs-internal/aot.md).

Methods

Method SignatureReturnsDescription
static # Get(object obj, string path)object
static # RegisterUnwrapper<TWrapper>(Func<TWrapper, object> unwrap)voidRegisters a converter for wrapper value types of document databases, e.g. PropertyPath.RegisterUnwrapper<BsonValue>(v => v.RawValue) for LiteDB.
RawZplItem Raw ZPL inserted as-is (escape hatch for commands not covered by items). class3 members#
public sealed class RawZplItem : LabelItem

Raw ZPL inserted as-is (escape hatch for commands not covered by items).

Constructors

SignatureDescription
# RawZplItem()

Properties

PropertyTypeDescription
Zpl { get; set; }string

Methods

Method SignatureReturnsDescription
# ToZpl(ZplContext ctx)string
RectangleItem class11 members#
public sealed class RectangleItem : LabelItem

Constructors

SignatureDescription
# RectangleItem()

Properties

PropertyTypeDescription
CornerRadius { get; set; }CornerRadiusIndividual corner radii in label units (graphic when not expressible by ^GB).
CornerRounding { get; set; }intCorner rounding 0–8 (^GB r).
Fill { get; set; }ItemColorInterior fill (None = transparent).
Filled { get; set; }boolLegacy: same as RectangleItem.Fill = ItemColor.Black (white when RectangleItem.White).
Height { get; set; }double
StrokeStyle { get; set; }StrokeStyle
StrokeThickness { get; set; }doubleBorder thickness in label units; ≥ half the size gives a filled box.
White { get; set; }boolStroke colour white (^GB W).
Width { get; set; }double

Methods

Method SignatureReturnsDescription
# ToZpl(ZplContext ctx)string
RepeaterItem Repeats its child items for every element of a collection field (e.g. order lines), shifting each repetition by RepeaterItem.Of… class6 members#
public sealed class RepeaterItem : LabelItem

Repeats its child items for every element of a collection field (e.g. order lines), shifting each repetition by RepeaterItem.OffsetX/RepeaterItem.OffsetY. Children bind to the element's members.

Constructors

SignatureDescription
# RepeaterItem()

Properties

PropertyTypeDescription
Items { get; set; }List<LabelItem>
MaxCount { get; set; }int
OffsetX { get; set; }double
OffsetY { get; set; }double

Methods

Method SignatureReturnsDescription
# ToZpl(ZplContext ctx)string
RfidItem RFID tag write (^RF). Not printed; encodes RfidItem.Data into the tag. class17 members#
public sealed class RfidItem : LabelItem

RFID tag write (^RF). Not printed; encodes RfidItem.Data into the tag.

Constructors

SignatureDescription
# RfidItem()

Properties

PropertyTypeDescription
AccessPassword { get; set; }stringAccess password, 8 hex digits (^RZ…,A).
AccessPasswordLock { get; set; }RfidLockValue
Bank { get; set; }stringLegacy ^RF bank parameter written verbatim (prefer RfidItem.MemoryBank).
Data { get; set; }string
EpcDataStructure { get; set; }stringEPC data structure for format E, e.g. "96,8,3,3,20,24,38" (^RB).
Format { get; set; }charH = hex, A = ASCII, E = EPC.
KillPassword { get; set; }stringKill password, 8 hex digits (^RZ…,K).
KillPasswordLock { get; set; }RfidLockValue
MemoryBank { get; set; }RfidMemoryBank
MemoryBankLock { get; set; }RfidLockValueLock of RfidItem.MemoryBank after writing (^RZ with the bank).
NumberOfBytes { get; set; }int?Number of bytes to write (^RF n).
PermaLockBlockCount { get; set; }int
PermaLockStartBlock { get; set; }int?Gen2 block permalock: first block and count (^RLB).
StartingBlock { get; set; }int?Starting block/word (^RF b).
TagType { get; set; }RfidTagType

Methods

Method SignatureReturnsDescription
# ToZpl(ZplContext ctx)string
RfidLockValue Lock action for a password or memory bank. enum5 members#
public enum RfidLockValue

Lock action for a password or memory bank.

Values

NameValueDescription
None0
Lock1Write-lock (L).
Open2Permanently unlocked (O).
Unlock3Unlocked (U).
Protected4Permanently locked (P).
RfidMemoryBank Gen2 memory bank (^RF m / ^RZ m). enum6 members#
public enum RfidMemoryBank

Gen2 memory bank (^RF m / ^RZ m).

Values

NameValueDescription
Default0
Epc1
Tid2
User3
Reserved4
EpcAutoPc5EPC at bit 20h with PC length bits adjusted to the data (^RF memory bank A, RFID Programming Guide 3).
RfidTagType RFID tag type (^RS tag type parameter). enum11 members#
public enum RfidTagType

RFID tag type (^RS tag type parameter).

Values

StrokeStyle enum4 members#
public enum StrokeStyle

Values

NameValueDescription
Solid0
Dash1
Dot2
DashDot3
Symbology Label symbologies: every symbology of Barcode. Those with a ZPL barcode command are emitted natively, the others are rendered b… enum144 members#
public enum Symbology

Label symbologies: every symbology of Barcode. Those with a ZPL barcode command are emitted natively, the others are rendered by the generator and sent as ^GFA graphic.

Values

NameValueDescription
Code1280
Code391
Code932
Ean133
Ean84
UpcA5
UpcE6
Interleaved2of57
Codabar8
Msi9
Plessey10
Gs1_12811
QrCode12
DataMatrix13
Pdf41714
Aztec15
MaxiCode16
MicroQr17No ZPL command exists; emitted as a ^GFA graphic.
Code1118
Industrial2of519
Standard2of520
Logmars21
Postnet22
Planet23
UpcEanExtension24
DataBarOmnidirectional25
DataBarTruncated26
DataBarStacked27
DataBarStackedOmnidirectional28
DataBarLimited29
DataBarExpanded30
CodablockF31
Code4932
MicroPdf41733
IntelligentMail34
Code16K35
Pdf417Compact36
DataBarExpandedStacked37
Code39Extended38
Telepen39
Pharmacode40
Leitcode41
Identcode42
Pzn43
Code3244
RoyalMail45
Kix46
AustraliaPost47
JapanPost48
Daft49
RectMicroQrCode50
Gs1QrCode51
SwissQrCode52
EpcQrCode53
DataMatrixRectangular54
Gs1DataMatrix55
AztecRune56
Gs1Aztec57
HanXin58
DotCode59
Ultracode60
Isbn61
Issn62
Ismn63
Jan64
Vin65
HibcCode3966
HibcCode12867
Code93Extended68
Matrix2of569
Iata2of570
Datalogic2of571
Coop2of572
TelepenNumeric73
ChannelCode74
PharmacodeTwoTrack75
Sscc1876
Ean1477
Itf1478
Ean13Composite79
Ean8Composite80
UpcAComposite81
UpcEComposite82
Gs1_128Composite83
DataBarOmniComposite84
DataBarStackedComposite85
DataBarLimitedComposite86
DataBarExpandedComposite87
DataBarExpandedStackedComposite88
UspsFim89
SwissPostParcel90
UspsTrayLabel91
UspsSackLabel92
UspsImpb93
UspsPic94
FedExGround9695
VicsBol96
VicsScacPro97
ItalianPost2of598
DhlAwb99
Dun14Itf100
Jan8101
Ean99102
Numly103
Isbt128104
Isbt128DataMatrix105
HibcDataMatrix106
HibcQrCode107
HibcAztec108
HibcCodablockF109
HibcMicroPdf417110
IfaDataMatrix111
PpnDataMatrix112
VinQrCode113
VinDataMatrix114
Semacode115
MailmarkCmdm116
KoreaPost117
Mailmark4State118
Dpd119
UpuS10120
Flattermarken121
Bc412122
UpnQr123
GridMatrix124
CodeOne125
DataBarTruncatedComposite126
DataBarStackedOmniComposite127
EanVelocity128
DanishPostal39129
FrenchPostal39AR130
TriOptic131
Opc132
KodakPatch133
UspsHorizontalBars134
Imcb135
AusPostEParcel136
Scc14137
Gs1RectMicroQrCode138
DinSpecDataMatrix139
DinSpecQrCode140
JabCode141
Tlc39142
DeutschePostBzl143
TableItem Table with fixed columns/rows; cells may contain [Field] placeholders. class20 members#
public sealed class TableItem : LabelItem

Table with fixed columns/rows; cells may contain [Field] placeholders.

Constructors

SignatureDescription
# TableItem()

Properties

PropertyTypeDescription
Alignment { get; set; }TextAlignment
CellPadding { get; set; }double
Cells { get; set; }List<List<string>>Cell texts, row by row. "[Name]" is replaced by the bound field value.
ColumnFills { get; set; }List<ItemColor>Fill per column (index = column), applied where the row has no fill.
ColumnWidths { get; set; }List<double>Column widths in label units.
CornerRounding { get; set; }intCorner rounding of the outer frame, 0–8 like ^GB (only when all four sides are shown).
Font { get; set; }string
FontSize { get; set; }double
HeaderRow { get; set; }boolFirst row bold/inverted as header.
RowFills { get; set; }List<ItemColor>Fill per row (index = row); black rows print their text white.
RowHeights { get; set; }List<double>Row heights in label units.
ShowBottom { get; set; }bool
ShowColumnLines { get; set; }boolVertical lines between columns.
ShowLeft { get; set; }boolOuter border sides.
ShowRight { get; set; }bool
ShowRowLines { get; set; }boolHorizontal lines between rows.
ShowTop { get; set; }bool
StrokeThickness { get; set; }double

Methods

Method SignatureReturnsDescription
# ToZpl(ZplContext ctx)string
TextAlignment enum4 members#
public enum TextAlignment

Values

NameValueDescription
Left0
Center1
Right2
Justify3
TextItem class46 members#
public sealed class TextItem : LabelItem

Constructors

SignatureDescription
# TextItem()

Properties

PropertyTypeDescription
Alignment { get; set; }TextAlignment
AutoFit { get; set; }boolLegacy (schema 1): same as TextItem.Sizing = TextSizing.ShrinkToFit.
Background { get; set; }ItemColorBox fill behind the text (needs TextItem.Width).
Bold { get; set; }bool
BorderCornerRounding { get; set; }intBox corner rounding 0–8 (^GB r).
BorderThickness { get; set; }doubleBox border thickness in label units (0 = none; needs TextItem.Width).
CharSpacing { get; set; }doubleExtra space between characters in label units (^FP gap).
CounterStep { get; set; }intCounter: add Index × step to the trailing number of the text (e.g. "A0001").
CounterUseLeadingZeros { get; set; }boolCounter keeps the field width with leading zeros ("A0001" → "A0002"); false drops them ("A2").
CultureName { get; set; }stringCulture for formatting bound values, e.g. "de-DE" (null = current culture).
Font { get; set; }stringZPL font: "0" (scalable), "A".."H" (bitmap) or a downloaded font like "E:ARIAL.TTF".
FontSize { get; set; }doubleCharacter height in TextItem.FontUnit (points by default).
FontUnit { get; set; }FontUnit
FontWidthScale { get; set; }doubleWidth scale relative to height (1 = normal).
ForeColor { get; set; }ItemColorText colour; ItemColor.White prints white (reverse) over a black background.
FrameThickness { get; set; }FrameThicknessFrame with an individual line thickness per side (drawn instead of / in addition to TextItem.BorderThickness).
Height { get; set; }double?Box height (vertical alignment, background, border, fitting).
HideIfEmpty { get; set; }boolEmit nothing when the (bound) text is empty.
InputMask { get; set; }stringInput mask for label editors, e.g. "AA-0000" (A letter, 0 digit, * any); checked by Label.Validate.
InputMaskPromptChar { get; set; }char?Prompt character label editors show for unfilled TextItem.InputMask positions (e.g. '_'); Label.Validate reports text still containing it at an input position as incomplete.
IsCounter { get; }boolTrue when the text changes per printed label (counter).
Italic { get; set; }bool
LineSpacing { get; set; }double
Mask { get; set; }stringCounter mask, e.g. "AA-0000" or "####-??" (#/0 digit, A A–Z, a a–z, ? 0–9A–Z, others literal). The (bound) text is the start value; see TextItem.MaskIncrement.
MaskIncrement { get; set; }stringIncrement per printed label for TextItem.Mask: "+1", "-2" or per position like "0010" (carry, wrap-around).
MaxLength { get; set; }intCut the text after this many characters (0 = unlimited).
MaxLines { get; set; }int
MinFontSize { get; set; }double
OutlineThickness { get; set; }doubleDraw only the outline of the glyphs, this thick in label units (graphic).
OverflowItemName { get; set; }stringTarget item of TextSizing.OverflowSplit (must come later in the item list).
Padding { get; set; }ItemPadding
RightToLeft { get; set; }boolRight-to-left print direction (^FPR).
Rotation { get; set; }ItemRotation
ScaleY { get; set; }doubleHeight scale (1 = normal).
Sizing { get; set; }TextSizing
SlashedZero { get; set; }boolPrint zeros as slashed zeros (Ø).
Strikeout { get; set; }bool
Text { get; set; }string
Underline { get; set; }bool
ValidationErrorMessage { get; set; }stringMessage reported by Label.Validate instead of the built-in ones when TextItem.ValidationRegex or TextItem.InputMask fails; {name} and {value} are replaced.
ValidationRegex { get; set; }stringRegular expression the text must match (checked by Label.Validate).
VerticalAlignment { get; set; }TextVerticalAlignment
Width { get; set; }double?Block width; when set the text wraps (^FB).

Methods

Method SignatureReturnsDescription
# InputMaskPrompt()stringThe TextItem.InputMask as an editor shows it while empty (input positions replaced by the prompt char).
# ToZpl(ZplContext ctx)string
TextSizing How a TextItem adapts its text to the box. enum8 members#
public enum TextSizing

How a TextItem adapts its text to the box.

Values

NameValueDescription
None0Fixed font size.
ShrinkToFit1Shrink the font (down to TextItem.MinFontSize) until the text fits (^FB, native).
FitToBox2Largest font size whose wrapped text fits TextItem.Width × TextItem.Height (native).
Stretch3Scale the rendered text non-proportionally to fill the box (graphic).
Arc4Text bent along the top of a circle (graphic).
OuterArc5Text bent along the bottom of a circle, upright (graphic).
Vertical6Characters stacked top to bottom (^FPV, native).
OverflowSplit7Text that doesn't fit TextItem.MaxLines continues in the item named TextItem.OverflowItemName.
TextVerticalAlignment enum3 members#
public enum TextVerticalAlignment

Values

NameValueDescription
Top0
Middle1
Bottom2
UnitConverter Conversions between label units and dots. class3 members#
public static class UnitConverter

Conversions between label units and dots.

Methods

Method SignatureReturnsDescription
static # Convert(double value, LabelUnit from, LabelUnit to, int dpi = 203)doubleConverts value from one unit to another (dpi only matters for dots).
static # DotsPerUnit(LabelUnit unit, int dpi)double
static # FontDots(double size, FontUnit unit, int dpi)doubleFont size in dots.
ZplContext class16 members#
public sealed class ZplContext

Constructors

SignatureDescription
# ZplContext(int dpi, LabelUnit unit, Func<string, object> fieldResolver, int index)

Properties

PropertyTypeDescription
Dpi { get; }int
Engine { get; init; }ExpressionEngine
FieldResolver { get; }Func<string, object>Resolves a data field name for the current record (null = unbound/not found).
Index { get; }intZero-based record index.
ItemValues { get; }Dictionary<string, string>Resolved text of named items generated so far (usable as [ItemName] in expressions).
Measurer { get; init; }ITextMeasurerText measurement for auto-fit (provided by the label, uses its fonts).
Serial { get; init; }intZero-based printed-label number (records × copies) used by counters; -1 = same as ZplContext.Index.
Unit { get; }LabelUnit

Methods

Method SignatureReturnsDescription
# Dots(double value)int
# Dots(double value, LabelUnit? unit)intConverts a value given in unit (null = the label unit) to dots.
# DotsExact(double value, LabelUnit? unit = default)doubleExact (unrounded) dots for a value in unit (null = the label unit).
# Evaluate(string expression)string
# Lookup(string field, string format)string
# Lookup(string field, string format, CultureInfo culture)stringLooks up and formats a field value with an explicit culture (null = current culture).
# PointsToDots(double pt)intFont sizes are always given in points.

ZplCore.Parsing #

110 types

Low-level ZPL II parser, command AST, and typed ZPL document builder (ZplDocument, ZplBuilder, ZplParser).

AdvancedTextPropertiesCommand ^PA – Advanced text properties. class6 members#
public sealed class AdvancedTextPropertiesCommand : ZplCommandBase

^PA – Advanced text properties.

Constructors

SignatureDescription
# AdvancedTextPropertiesCommand()

Properties

PropertyTypeDescription
Bidi { get; set; }int?
Code { get; }string
DefaultGlyph { get; set; }int?
OpenType { get; set; }int?
Shaping { get; set; }int?
AztecCommand ^B0 – Aztec. class9 members#
public sealed class AztecCommand : ZplCommandBase

^B0 – Aztec.

Constructors

SignatureDescription
# AztecCommand()

Properties

PropertyTypeDescription
Code { get; }string
ErrorControl { get; set; }int?
ExtendedChannel { get; set; }bool?
Magnification { get; set; }int?
MenuSymbol { get; set; }bool?
Orientation { get; set; }ZplOrientation?
StructuredAppendId { get; set; }string
SymbolCount { get; set; }int?
AztecOCommand ^BO – Aztec (^BO). class9 members#
public sealed class AztecOCommand : ZplCommandBase

^BO – Aztec (^BO).

Constructors

SignatureDescription
# AztecOCommand()

Properties

PropertyTypeDescription
Code { get; }string
ErrorControl { get; set; }int?
ExtendedChannel { get; set; }bool?
Magnification { get; set; }int?
MenuSymbol { get; set; }bool?
Orientation { get; set; }ZplOrientation?
StructuredAppendId { get; set; }string
SymbolCount { get; set; }int?
BarcodeDefaultCommand ^BY – Barcode field default. class5 members#
public sealed class BarcodeDefaultCommand : ZplCommandBase

^BY – Barcode field default.

Constructors

SignatureDescription
# BarcodeDefaultCommand()

Properties

PropertyTypeDescription
Code { get; }string
Height { get; set; }int?
ModuleWidth { get; set; }int?
Ratio { get; set; }double?
CancelAllCommand ~JA – Cancel all. class2 members#
public sealed class CancelAllCommand : ZplCommandBase

~JA – Cancel all.

Constructors

SignatureDescription
# CancelAllCommand()

Properties

PropertyTypeDescription
Code { get; }string
ChangeCaretCommand ^CC – Change caret. class3 members#
public sealed class ChangeCaretCommand : ZplCommandBase

^CC – Change caret.

Constructors

SignatureDescription
# ChangeCaretCommand()

Properties

PropertyTypeDescription
Character { get; set; }char?
Code { get; }string
ChangeDefaultFontCommand ^CF – Change alphanumeric default font. class5 members#
public sealed class ChangeDefaultFontCommand : ZplCommandBase

^CF – Change alphanumeric default font.

Constructors

SignatureDescription
# ChangeDefaultFontCommand()

Properties

PropertyTypeDescription
Code { get; }string
Font { get; set; }char?
Height { get; set; }int?
Width { get; set; }int?
ChangeDelimiterCommand ^CD – Change delimiter. class3 members#
public sealed class ChangeDelimiterCommand : ZplCommandBase

^CD – Change delimiter.

Constructors

SignatureDescription
# ChangeDelimiterCommand()

Properties

PropertyTypeDescription
Character { get; set; }char?
Code { get; }string
ChangeFontAliasCommand ^CW – Font identifier. class4 members#
public sealed class ChangeFontAliasCommand : ZplCommandBase

^CW – Font identifier.

Constructors

SignatureDescription
# ChangeFontAliasCommand()

Properties

PropertyTypeDescription
Alias { get; set; }char?
Code { get; }string
Path { get; set; }string
ChangeInternationalEncodingCommand ^CI – Change international font/encoding. class5 members#
public sealed class ChangeInternationalEncodingCommand : ZplCommandBase

^CI – Change international font/encoding.

Constructors

SignatureDescription
# ChangeInternationalEncodingCommand()

Properties

PropertyTypeDescription
Charset { get; set; }int?
Code { get; }string
Dest1 { get; set; }int?
Source1 { get; set; }int?
ChangeTildeCommand ^CT – Change tilde. class3 members#
public sealed class ChangeTildeCommand : ZplCommandBase

^CT – Change tilde.

Constructors

SignatureDescription
# ChangeTildeCommand()

Properties

PropertyTypeDescription
Character { get; set; }char?
Code { get; }string
CodabarCommand ^BK – ANSI Codabar. class9 members#
public sealed class CodabarCommand : ZplCommandBase

^BK – ANSI Codabar.

Constructors

SignatureDescription
# CodabarCommand()

Properties

PropertyTypeDescription
AboveCode { get; set; }bool?
CheckDigit { get; set; }bool?
Code { get; }string
Height { get; set; }int?
Orientation { get; set; }ZplOrientation?
PrintInterpretation { get; set; }bool?
StartCharacter { get; set; }char?
StopCharacter { get; set; }char?
CodablockCommand ^BB – CODABLOCK. class8 members#
public sealed class CodablockCommand : ZplCommandBase

^BB – CODABLOCK.

Constructors

SignatureDescription
# CodablockCommand()

Properties

PropertyTypeDescription
Code { get; }string
Columns { get; set; }int?
Mode { get; set; }char?
Orientation { get; set; }ZplOrientation?
RowHeight { get; set; }int?
Rows { get; set; }int?
Security { get; set; }bool?
Code11Command ^B1 – Code 11. class7 members#
public sealed class Code11Command : ZplCommandBase

^B1 – Code 11.

Constructors

SignatureDescription
# Code11Command()

Properties

PropertyTypeDescription
AboveCode { get; set; }bool?
CheckDigit { get; set; }bool?
Code { get; }string
Height { get; set; }int?
Orientation { get; set; }ZplOrientation?
PrintInterpretation { get; set; }bool?
Code128Command ^BC – Code 128. class8 members#
public sealed class Code128Command : ZplCommandBase

^BC – Code 128.

Constructors

SignatureDescription
# Code128Command()

Properties

PropertyTypeDescription
AboveCode { get; set; }bool?
Code { get; }string
Height { get; set; }int?
Mode { get; set; }char?
Orientation { get; set; }ZplOrientation?
PrintInterpretation { get; set; }bool?
UccCheckDigit { get; set; }bool?
Code39Command ^B3 – Code 39. class7 members#
public sealed class Code39Command : ZplCommandBase

^B3 – Code 39.

Constructors

SignatureDescription
# Code39Command()

Properties

PropertyTypeDescription
AboveCode { get; set; }bool?
CheckDigit { get; set; }bool?
Code { get; }string
Height { get; set; }int?
Orientation { get; set; }ZplOrientation?
PrintInterpretation { get; set; }bool?
Code49Command ^B4 – Code 49. class6 members#
public sealed class Code49Command : ZplCommandBase

^B4 – Code 49.

Constructors

SignatureDescription
# Code49Command()

Properties

PropertyTypeDescription
Code { get; }string
HeightMultiplier { get; set; }int?
Orientation { get; set; }ZplOrientation?
PrintInterpretation { get; set; }char?
StartingMode { get; set; }char?
Code93Command ^BA – Code 93. class7 members#
public sealed class Code93Command : ZplCommandBase

^BA – Code 93.

Constructors

SignatureDescription
# Code93Command()

Properties

PropertyTypeDescription
AboveCode { get; set; }bool?
CheckDigit { get; set; }bool?
Code { get; }string
Height { get; set; }int?
Orientation { get; set; }ZplOrientation?
PrintInterpretation { get; set; }bool?
CommentCommand ^FX – Comment. class3 members#
public sealed class CommentCommand : ZplCommandBase

^FX – Comment.

Constructors

SignatureDescription
# CommentCommand()

Properties

PropertyTypeDescription
Code { get; }string
Text { get; set; }string
DataBarCommand ^BR – GS1 DataBar. class8 members#
public sealed class DataBarCommand : ZplCommandBase

^BR – GS1 DataBar.

Constructors

SignatureDescription
# DataBarCommand()

Properties

PropertyTypeDescription
Code { get; }string
Height { get; set; }int?
Magnification { get; set; }int?
Orientation { get; set; }ZplOrientation?
SegmentWidth { get; set; }int?
SeparatorHeight { get; set; }int?
SymbologyType { get; set; }int?
DataMatrixCommand ^BX – Data Matrix. class10 members#
public sealed class DataMatrixCommand : ZplCommandBase

^BX – Data Matrix.

Constructors

SignatureDescription
# DataMatrixCommand()

Properties

PropertyTypeDescription
AspectRatio { get; set; }int?
Code { get; }string
Columns { get; set; }int?
EscapeCharacter { get; set; }char?
FormatId { get; set; }int?
Height { get; set; }int?
Orientation { get; set; }ZplOrientation?
Quality { get; set; }int?
Rows { get; set; }int?
DownloadBitmapFontCommand ~DB – Download bitmap font. class12 members#
public sealed class DownloadBitmapFontCommand : ZplCommandBase

~DB – Download bitmap font.

Constructors

SignatureDescription
# DownloadBitmapFontCommand()

Properties

PropertyTypeDescription
BaseLine { get; set; }int?
Code { get; }string
Copyright { get; set; }string
Count { get; set; }int?
Data { get; set; }string
DataText { get; }stringAll data after the header parameters (may itself contain commas).
Height { get; set; }int?
Name { get; set; }string
Orientation { get; set; }ZplOrientation?
Space { get; set; }int?
Width { get; set; }int?
DownloadFormatCommand ^DF – Download format. class3 members#
public sealed class DownloadFormatCommand : ZplCommandBase

^DF – Download format.

Constructors

SignatureDescription
# DownloadFormatCommand()

Properties

PropertyTypeDescription
Code { get; }string
Name { get; set; }string
DownloadGraphicCommand ~DG – Download graphic. class7 members#
public sealed class DownloadGraphicCommand : ZplCommandBase

~DG – Download graphic.

Constructors

SignatureDescription
# DownloadGraphicCommand()

Properties

PropertyTypeDescription
BytesPerRow { get; set; }int?
Code { get; }string
Data { get; set; }string
DataText { get; }stringAll data after the header parameters (may itself contain commas).
Name { get; set; }string
TotalBytes { get; set; }int?
DownloadObjectsCommand ~DY – Download objects. class9 members#
public sealed class DownloadObjectsCommand : ZplCommandBase

~DY – Download objects.

Constructors

SignatureDescription
# DownloadObjectsCommand()

Properties

PropertyTypeDescription
BytesPerRow { get; set; }int?
Code { get; }string
Data { get; set; }string
DataText { get; }stringAll data after the header parameters (may itself contain commas).
Extension { get; set; }char?
Format { get; set; }char?
Name { get; set; }string
TotalBytes { get; set; }int?
DownloadUnboundedFontCommand ~DU – Download unbounded TrueType font. class6 members#
public sealed class DownloadUnboundedFontCommand : ZplCommandBase

~DU – Download unbounded TrueType font.

Constructors

SignatureDescription
# DownloadUnboundedFontCommand()

Properties

PropertyTypeDescription
Code { get; }string
Data { get; set; }string
DataText { get; }stringAll data after the header parameters (may itself contain commas).
Name { get; set; }string
Size { get; set; }int?
Ean13Command ^BE – EAN-13. class6 members#
public sealed class Ean13Command : ZplCommandBase

^BE – EAN-13.

Constructors

SignatureDescription
# Ean13Command()

Properties

PropertyTypeDescription
AboveCode { get; set; }bool?
Code { get; }string
Height { get; set; }int?
Orientation { get; set; }ZplOrientation?
PrintInterpretation { get; set; }bool?
Ean8Command ^B8 – EAN-8. class6 members#
public sealed class Ean8Command : ZplCommandBase

^B8 – EAN-8.

Constructors

SignatureDescription
# Ean8Command()

Properties

PropertyTypeDescription
AboveCode { get; set; }bool?
Code { get; }string
Height { get; set; }int?
Orientation { get; set; }ZplOrientation?
PrintInterpretation { get; set; }bool?
EndFormatCommand ^XZ – End format. class2 members#
public sealed class EndFormatCommand : ZplCommandBase

^XZ – End format.

Constructors

SignatureDescription
# EndFormatCommand()

Properties

PropertyTypeDescription
Code { get; }string
EraseGraphicsCommand ~EG – Erase download graphics. class2 members#
public sealed class EraseGraphicsCommand : ZplCommandBase

~EG – Erase download graphics.

Constructors

SignatureDescription
# EraseGraphicsCommand()

Properties

PropertyTypeDescription
Code { get; }string
FieldBlockCommand ^FB – Field block. class7 members#
public sealed class FieldBlockCommand : ZplCommandBase

^FB – Field block.

Constructors

SignatureDescription
# FieldBlockCommand()

Properties

PropertyTypeDescription
Code { get; }string
HangingIndent { get; set; }int?
Justification { get; set; }char?
LineSpacing { get; set; }int?
MaxLines { get; set; }int?
Width { get; set; }int?
FieldClockCommand ^FC – Field clock indicators. class5 members#
public sealed class FieldClockCommand : ZplCommandBase

^FC – Field clock indicators.

Constructors

SignatureDescription
# FieldClockCommand()

Properties

PropertyTypeDescription
Code { get; }string
Primary { get; set; }char?
Secondary { get; set; }char?
Tertiary { get; set; }char?
FieldDataCommand ^FD – Field data. class3 members#
public sealed class FieldDataCommand : ZplCommandBase

^FD – Field data.

Constructors

SignatureDescription
# FieldDataCommand()

Properties

PropertyTypeDescription
Code { get; }string
Data { get; set; }string
FieldHexCommand ^FH – Field hexadecimal indicator. class3 members#
public sealed class FieldHexCommand : ZplCommandBase

^FH – Field hexadecimal indicator.

Constructors

SignatureDescription
# FieldHexCommand()

Properties

PropertyTypeDescription
Code { get; }string
Indicator { get; set; }char?
FieldLinkCommand ^FL – Font linking. class5 members#
public sealed class FieldLinkCommand : ZplCommandBase

^FL – Font linking.

Constructors

SignatureDescription
# FieldLinkCommand()

Properties

PropertyTypeDescription
Code { get; }string
Height { get; set; }int?
Mode { get; set; }int?
Width { get; set; }int?
FieldNumberCommand ^FN – Field number: ^FN#"prompt". class4 members#
public sealed class FieldNumberCommand : ZplCommandBase

^FN – Field number: ^FN#"prompt".

Constructors

SignatureDescription
# FieldNumberCommand()

Properties

PropertyTypeDescription
Code { get; }string
Number { get; set; }int?
Prompt { get; set; }string
FieldOrientationCommand ^FW – Field default orientation. class4 members#
public sealed class FieldOrientationCommand : ZplCommandBase

^FW – Field default orientation.

Constructors

SignatureDescription
# FieldOrientationCommand()

Properties

PropertyTypeDescription
Code { get; }string
Justification { get; set; }int?
Orientation { get; set; }ZplOrientation?
FieldOriginCommand ^FO – Field origin. class5 members#
public sealed class FieldOriginCommand : ZplCommandBase

^FO – Field origin.

Constructors

SignatureDescription
# FieldOriginCommand()

Properties

PropertyTypeDescription
Code { get; }string
Justification { get; set; }int?
X { get; set; }int?
Y { get; set; }int?
FieldParameterCommand ^FP – Field parameter (H/V/R). class4 members#
public sealed class FieldParameterCommand : ZplCommandBase

^FP – Field parameter (H/V/R).

Constructors

SignatureDescription
# FieldParameterCommand()

Properties

PropertyTypeDescription
Code { get; }string
Direction { get; set; }char?
Gap { get; set; }int?
FieldReverseCommand ^FR – Field reverse print. class2 members#
public sealed class FieldReverseCommand : ZplCommandBase

^FR – Field reverse print.

Constructors

SignatureDescription
# FieldReverseCommand()

Properties

PropertyTypeDescription
Code { get; }string
FieldSeparatorCommand ^FS – Field separator. class2 members#
public sealed class FieldSeparatorCommand : ZplCommandBase

^FS – Field separator.

Constructors

SignatureDescription
# FieldSeparatorCommand()

Properties

PropertyTypeDescription
Code { get; }string
FieldTypesetCommand ^FT – Field typeset (baseline origin). class5 members#
public sealed class FieldTypesetCommand : ZplCommandBase

^FT – Field typeset (baseline origin).

Constructors

SignatureDescription
# FieldTypesetCommand()

Properties

PropertyTypeDescription
Code { get; }string
Justification { get; set; }int?
X { get; set; }int?
Y { get; set; }int?
FieldVariableCommand ^FV – Field variable. class3 members#
public sealed class FieldVariableCommand : ZplCommandBase

^FV – Field variable.

Constructors

SignatureDescription
# FieldVariableCommand()

Properties

PropertyTypeDescription
Code { get; }string
Data { get; set; }string
FontCommand ^A – Scalable/bitmapped font: ^Afo,h,w (and ^A@o,h,w,d:o.x for downloaded fonts). class8 members#
public sealed class FontCommand : ZplCommandBase

^A – Scalable/bitmapped font: ^Afo,h,w (and ^A@o,h,w,d:o.x for downloaded fonts).

Constructors

SignatureDescription
# FontCommand()

Properties

PropertyTypeDescription
Code { get; }string
FontPath { get; set; }stringFont file (only for ^A@), e.g. "E:ARIAL.TTF".
Height { get; set; }int?
Name { get; set; }stringFont name (0, A–Z, 1–9, or '@' for a font referenced by path).
Orientation { get; set; }ZplOrientation?
ParameterText { get; set; }string
Width { get; set; }int?
GraphicBoxCommand ^GB – Graphic box. class7 members#
public sealed class GraphicBoxCommand : ZplCommandBase

^GB – Graphic box.

Constructors

SignatureDescription
# GraphicBoxCommand()

Properties

PropertyTypeDescription
Code { get; }string
Color { get; set; }char?
Height { get; set; }int?
Rounding { get; set; }int?
Thickness { get; set; }int?
Width { get; set; }int?
GraphicCircleCommand ^GC – Graphic circle. class5 members#
public sealed class GraphicCircleCommand : ZplCommandBase

^GC – Graphic circle.

Constructors

SignatureDescription
# GraphicCircleCommand()

Properties

PropertyTypeDescription
Code { get; }string
Color { get; set; }char?
Diameter { get; set; }int?
Thickness { get; set; }int?
GraphicDiagonalLineCommand ^GD – Graphic diagonal line. class7 members#
public sealed class GraphicDiagonalLineCommand : ZplCommandBase

^GD – Graphic diagonal line.

Constructors

SignatureDescription
# GraphicDiagonalLineCommand()

Properties

PropertyTypeDescription
Code { get; }string
Color { get; set; }char?
Direction { get; set; }char?
Height { get; set; }int?
Thickness { get; set; }int?
Width { get; set; }int?
GraphicEllipseCommand ^GE – Graphic ellipse. class6 members#
public sealed class GraphicEllipseCommand : ZplCommandBase

^GE – Graphic ellipse.

Constructors

SignatureDescription
# GraphicEllipseCommand()

Properties

PropertyTypeDescription
Code { get; }string
Color { get; set; }char?
Height { get; set; }int?
Thickness { get; set; }int?
Width { get; set; }int?
GraphicFieldCommand ^GF – Graphic field (Data = rest incl. commas: see DataText). class8 members#
public sealed class GraphicFieldCommand : ZplCommandBase

^GF – Graphic field (Data = rest incl. commas: see DataText).

Constructors

SignatureDescription
# GraphicFieldCommand()

Properties

PropertyTypeDescription
BinaryByteCount { get; set; }int?
BytesPerRow { get; set; }int?
Code { get; }string
Compression { get; set; }char?
Data { get; set; }string
DataText { get; }stringAll data after the header parameters (may itself contain commas).
GraphicFieldCount { get; set; }int?
GraphicSymbolCommand ^GS – Graphic symbol. class5 members#
public sealed class GraphicSymbolCommand : ZplCommandBase

^GS – Graphic symbol.

Constructors

SignatureDescription
# GraphicSymbolCommand()

Properties

PropertyTypeDescription
Code { get; }string
Height { get; set; }int?
Orientation { get; set; }ZplOrientation?
Width { get; set; }int?
HostIdentificationCommand ~HI – Host identification. class2 members#
public sealed class HostIdentificationCommand : ZplCommandBase

~HI – Host identification.

Constructors

SignatureDescription
# HostIdentificationCommand()

Properties

PropertyTypeDescription
Code { get; }string
HostQueryCommand ~HQ – Host query. class3 members#
public sealed class HostQueryCommand : ZplCommandBase

~HQ – Host query.

Constructors

SignatureDescription
# HostQueryCommand()

Properties

PropertyTypeDescription
Code { get; }string
Query { get; set; }string
HostStatusCommand ~HS – Host status return. class2 members#
public sealed class HostStatusCommand : ZplCommandBase

~HS – Host status return.

Constructors

SignatureDescription
# HostStatusCommand()

Properties

PropertyTypeDescription
Code { get; }string
ImageLoadCommand ^IL – Image load. class3 members#
public sealed class ImageLoadCommand : ZplCommandBase

^IL – Image load.

Constructors

SignatureDescription
# ImageLoadCommand()

Properties

PropertyTypeDescription
Code { get; }string
Name { get; set; }string
ImageMoveCommand ^IM – Image move. class3 members#
public sealed class ImageMoveCommand : ZplCommandBase

^IM – Image move.

Constructors

SignatureDescription
# ImageMoveCommand()

Properties

PropertyTypeDescription
Code { get; }string
Name { get; set; }string
Industrial2of5Command ^BI – Industrial 2 of 5. class6 members#
public sealed class Industrial2of5Command : ZplCommandBase

^BI – Industrial 2 of 5.

Constructors

SignatureDescription
# Industrial2of5Command()

Properties

PropertyTypeDescription
AboveCode { get; set; }bool?
Code { get; }string
Height { get; set; }int?
Orientation { get; set; }ZplOrientation?
PrintInterpretation { get; set; }bool?
Interleaved2of5Command ^B2 – Interleaved 2 of 5. class7 members#
public sealed class Interleaved2of5Command : ZplCommandBase

^B2 – Interleaved 2 of 5.

Constructors

SignatureDescription
# Interleaved2of5Command()

Properties

PropertyTypeDescription
AboveCode { get; set; }bool?
CheckDigit { get; set; }bool?
Code { get; }string
Height { get; set; }int?
Orientation { get; set; }ZplOrientation?
PrintInterpretation { get; set; }bool?
JobResetCommand ^JR – Reset (^JR). class2 members#
public sealed class JobResetCommand : ZplCommandBase

^JR – Reset (^JR).

Constructors

SignatureDescription
# JobResetCommand()

Properties

PropertyTypeDescription
Code { get; }string
LabelHomeCommand ^LH – Label home. class4 members#
public sealed class LabelHomeCommand : ZplCommandBase

^LH – Label home.

Constructors

SignatureDescription
# LabelHomeCommand()

Properties

PropertyTypeDescription
Code { get; }string
X { get; set; }int?
Y { get; set; }int?
LabelLengthCommand ^LL – Label length. class3 members#
public sealed class LabelLengthCommand : ZplCommandBase

^LL – Label length.

Constructors

SignatureDescription
# LabelLengthCommand()

Properties

PropertyTypeDescription
Code { get; }string
Length { get; set; }int?
LabelReversePrintCommand ^LR – Label reverse print. class3 members#
public sealed class LabelReversePrintCommand : ZplCommandBase

^LR – Label reverse print.

Constructors

SignatureDescription
# LabelReversePrintCommand()

Properties

PropertyTypeDescription
Code { get; }string
Enabled { get; set; }bool?
LabelShiftCommand ^LS – Label shift. class3 members#
public sealed class LabelShiftCommand : ZplCommandBase

^LS – Label shift.

Constructors

SignatureDescription
# LabelShiftCommand()

Properties

PropertyTypeDescription
Code { get; }string
Shift { get; set; }int?
LabelTopCommand ^LT – Label top. class3 members#
public sealed class LabelTopCommand : ZplCommandBase

^LT – Label top.

Constructors

SignatureDescription
# LabelTopCommand()

Properties

PropertyTypeDescription
Code { get; }string
Top { get; set; }int?
LogmarsCommand ^BL – LOGMARS. class5 members#
public sealed class LogmarsCommand : ZplCommandBase

^BL – LOGMARS.

Constructors

SignatureDescription
# LogmarsCommand()

Properties

PropertyTypeDescription
AboveCode { get; set; }bool?
Code { get; }string
Height { get; set; }int?
Orientation { get; set; }ZplOrientation?
MapClearCommand ^MC – Map clear. class3 members#
public sealed class MapClearCommand : ZplCommandBase

^MC – Map clear.

Constructors

SignatureDescription
# MapClearCommand()

Properties

PropertyTypeDescription
Clear { get; set; }bool?
Code { get; }string
MaxiCodeCommand ^BD – MaxiCode. class5 members#
public sealed class MaxiCodeCommand : ZplCommandBase

^BD – MaxiCode.

Constructors

SignatureDescription
# MaxiCodeCommand()

Properties

PropertyTypeDescription
Code { get; }string
Mode { get; set; }int?
SymbolNumber { get; set; }int?
TotalSymbols { get; set; }int?
MediaDarknessCommand ^MD – Media darkness. class3 members#
public sealed class MediaDarknessCommand : ZplCommandBase

^MD – Media darkness.

Constructors

SignatureDescription
# MediaDarknessCommand()

Properties

PropertyTypeDescription
Code { get; }string
Darkness { get; set; }double?
MediaModeCommand ^MM – Print mode. class4 members#
public sealed class MediaModeCommand : ZplCommandBase

^MM – Print mode.

Constructors

SignatureDescription
# MediaModeCommand()

Properties

PropertyTypeDescription
Code { get; }string
Mode { get; set; }char?
Prepeel { get; set; }char?
MediaTrackingCommand ^MN – Media tracking. class4 members#
public sealed class MediaTrackingCommand : ZplCommandBase

^MN – Media tracking.

Constructors

SignatureDescription
# MediaTrackingCommand()

Properties

PropertyTypeDescription
Code { get; }string
Offset { get; set; }int?
Tracking { get; set; }char?
MediaTypeCommand ^MT – Media type. class3 members#
public sealed class MediaTypeCommand : ZplCommandBase

^MT – Media type.

Constructors

SignatureDescription
# MediaTypeCommand()

Properties

PropertyTypeDescription
Code { get; }string
Type { get; set; }char?
MicroPdf417Command ^BF – MicroPDF417. class5 members#
public sealed class MicroPdf417Command : ZplCommandBase

^BF – MicroPDF417.

Constructors

SignatureDescription
# MicroPdf417Command()

Properties

PropertyTypeDescription
Code { get; }string
Height { get; set; }int?
Mode { get; set; }int?
Orientation { get; set; }ZplOrientation?
MsiCommand ^BM – MSI. class8 members#
public sealed class MsiCommand : ZplCommandBase

^BM – MSI.

Constructors

SignatureDescription
# MsiCommand()

Properties

PropertyTypeDescription
AboveCode { get; set; }bool?
CheckDigitType { get; set; }char?
Code { get; }string
Height { get; set; }int?
InsertCheckDigit { get; set; }bool?
Orientation { get; set; }ZplOrientation?
PrintInterpretation { get; set; }bool?
Pdf417Command ^B7 – PDF417. class8 members#
public sealed class Pdf417Command : ZplCommandBase

^B7 – PDF417.

Constructors

SignatureDescription
# Pdf417Command()

Properties

PropertyTypeDescription
Code { get; }string
Columns { get; set; }int?
Orientation { get; set; }ZplOrientation?
RowHeight { get; set; }int?
Rows { get; set; }int?
SecurityLevel { get; set; }int?
Truncate { get; set; }bool?
PlanetCommand ^B5 – Planet code. class6 members#
public sealed class PlanetCommand : ZplCommandBase

^B5 – Planet code.

Constructors

SignatureDescription
# PlanetCommand()

Properties

PropertyTypeDescription
AboveCode { get; set; }bool?
Code { get; }string
Height { get; set; }int?
Orientation { get; set; }ZplOrientation?
PrintInterpretation { get; set; }bool?
PlesseyCommand ^BP – Plessey. class7 members#
public sealed class PlesseyCommand : ZplCommandBase

^BP – Plessey.

Constructors

SignatureDescription
# PlesseyCommand()

Properties

PropertyTypeDescription
AboveCode { get; set; }bool?
CheckDigit { get; set; }bool?
Code { get; }string
Height { get; set; }int?
Orientation { get; set; }ZplOrientation?
PrintInterpretation { get; set; }bool?
PostalCodeCommand ^BZ – POSTAL / Intelligent Mail. class7 members#
public sealed class PostalCodeCommand : ZplCommandBase

^BZ – POSTAL / Intelligent Mail.

Constructors

SignatureDescription
# PostalCodeCommand()

Properties

PropertyTypeDescription
AboveCode { get; set; }bool?
Code { get; }string
Height { get; set; }int?
Orientation { get; set; }ZplOrientation?
PrintInterpretation { get; set; }bool?
Type { get; set; }int?
PrintMirrorCommand ^PM – Print mirror image. class3 members#
public sealed class PrintMirrorCommand : ZplCommandBase

^PM – Print mirror image.

Constructors

SignatureDescription
# PrintMirrorCommand()

Properties

PropertyTypeDescription
Code { get; }string
Enabled { get; set; }bool?
PrintOrientationCommand ^PO – Print orientation (N/I). class3 members#
public sealed class PrintOrientationCommand : ZplCommandBase

^PO – Print orientation (N/I).

Constructors

SignatureDescription
# PrintOrientationCommand()

Properties

PropertyTypeDescription
Code { get; }string
Orientation { get; set; }char?
PrintQuantityCommand ^PQ – Print quantity. class7 members#
public sealed class PrintQuantityCommand : ZplCommandBase

^PQ – Print quantity.

Constructors

SignatureDescription
# PrintQuantityCommand()

Properties

PropertyTypeDescription
Code { get; }string
CutOnError { get; set; }bool?
OverridePause { get; set; }bool?
PauseCount { get; set; }int?
Quantity { get; set; }int?
Replicates { get; set; }int?
PrintRateCommand ^PR – Print rate. class5 members#
public sealed class PrintRateCommand : ZplCommandBase

^PR – Print rate.

Constructors

SignatureDescription
# PrintRateCommand()

Properties

PropertyTypeDescription
BackfeedSpeed { get; set; }string
Code { get; }string
PrintSpeed { get; set; }string
SlewSpeed { get; set; }string
PrintWidthCommand ^PW – Print width. class3 members#
public sealed class PrintWidthCommand : ZplCommandBase

^PW – Print width.

Constructors

SignatureDescription
# PrintWidthCommand()

Properties

PropertyTypeDescription
Code { get; }string
Width { get; set; }int?
QrCodeCommand ^BQ – QR code. class7 members#
public sealed class QrCodeCommand : ZplCommandBase

^BQ – QR code.

Constructors

SignatureDescription
# QrCodeCommand()

Properties

PropertyTypeDescription
Code { get; }string
ErrorCorrection { get; set; }char?
Magnification { get; set; }int?
Mask { get; set; }int?
Model { get; set; }int?
Orientation { get; set; }ZplOrientation?
RecallFormatCommand ^XF – Recall format. class3 members#
public sealed class RecallFormatCommand : ZplCommandBase

^XF – Recall format.

Constructors

SignatureDescription
# RecallFormatCommand()

Properties

PropertyTypeDescription
Code { get; }string
Name { get; set; }string
RecallGraphicCommand ^XG – Recall graphic. class5 members#
public sealed class RecallGraphicCommand : ZplCommandBase

^XG – Recall graphic.

Constructors

SignatureDescription
# RecallGraphicCommand()

Properties

PropertyTypeDescription
Code { get; }string
MagnificationX { get; set; }int?
MagnificationY { get; set; }int?
Name { get; set; }string
RfidReadWriteCommand ^RF – Read or write RFID format. class7 members#
public sealed class RfidReadWriteCommand : ZplCommandBase

^RF – Read or write RFID format.

Constructors

SignatureDescription
# RfidReadWriteCommand()

Properties

PropertyTypeDescription
Bank { get; set; }char?
Bytes { get; set; }int?
Code { get; }string
Format { get; set; }char?
Operation { get; set; }char?
Start { get; set; }string
SerializationFieldCommand ^SN – Serialization data. class5 members#
public sealed class SerializationFieldCommand : ZplCommandBase

^SN – Serialization data.

Constructors

SignatureDescription
# SerializationFieldCommand()

Properties

PropertyTypeDescription
Code { get; }string
Increment { get; set; }string
LeadingZeros { get; set; }bool?
Start { get; set; }string
SerializationFieldStandardCommand ^SF – Serialization field with mask. class4 members#
public sealed class SerializationFieldStandardCommand : ZplCommandBase

^SF – Serialization field with mask.

Constructors

SignatureDescription
# SerializationFieldStandardCommand()

Properties

PropertyTypeDescription
Code { get; }string
Increment { get; set; }string
Mask { get; set; }string
SetDateTimeCommand ^ST – Set date and time. class9 members#
public sealed class SetDateTimeCommand : ZplCommandBase

^ST – Set date and time.

Constructors

SignatureDescription
# SetDateTimeCommand()

Properties

PropertyTypeDescription
Code { get; }string
Day { get; set; }int?
Format { get; set; }char?
Hour { get; set; }int?
Minute { get; set; }int?
Month { get; set; }int?
Second { get; set; }int?
Year { get; set; }int?
SetUnitsCommand ^MU – Set units of measurement. class5 members#
public sealed class SetUnitsCommand : ZplCommandBase

^MU – Set units of measurement.

Constructors

SignatureDescription
# SetUnitsCommand()

Properties

PropertyTypeDescription
Code { get; }string
Conversion { get; set; }int?
Format { get; set; }int?
Units { get; set; }char?
SlotTimeOffsetCommand ^SO – Set offset for real time clock. class9 members#
public sealed class SlotTimeOffsetCommand : ZplCommandBase

^SO – Set offset for real time clock.

Constructors

SignatureDescription
# SlotTimeOffsetCommand()

Properties

PropertyTypeDescription
Clock { get; set; }int?
Code { get; }string
Days { get; set; }int?
Hours { get; set; }int?
Minutes { get; set; }int?
Months { get; set; }int?
Seconds { get; set; }int?
Years { get; set; }int?
Standard2of5Command ^BJ – Standard 2 of 5. class6 members#
public sealed class Standard2of5Command : ZplCommandBase

^BJ – Standard 2 of 5.

Constructors

SignatureDescription
# Standard2of5Command()

Properties

PropertyTypeDescription
AboveCode { get; set; }bool?
Code { get; }string
Height { get; set; }int?
Orientation { get; set; }ZplOrientation?
PrintInterpretation { get; set; }bool?
StartFormatCommand ^XA – Start format. class2 members#
public sealed class StartFormatCommand : ZplCommandBase

^XA – Start format.

Constructors

SignatureDescription
# StartFormatCommand()

Properties

PropertyTypeDescription
Code { get; }string
TextBlockCommand ^TB – Text block. class5 members#
public sealed class TextBlockCommand : ZplCommandBase

^TB – Text block.

Constructors

SignatureDescription
# TextBlockCommand()

Properties

PropertyTypeDescription
Code { get; }string
Height { get; set; }int?
Orientation { get; set; }ZplOrientation?
Width { get; set; }int?
Tlc39Command ^BT – TLC39. class8 members#
public sealed class Tlc39Command : ZplCommandBase

^BT – TLC39.

Constructors

SignatureDescription
# Tlc39Command()

Properties

PropertyTypeDescription
Code { get; }string
Height1 { get; set; }int?
Height2 { get; set; }int?
ModuleWidth1 { get; set; }int?
ModuleWidth2 { get; set; }int?
Orientation { get; set; }ZplOrientation?
Ratio1 { get; set; }double?
UnknownCommand Fallback for commands without a dedicated class. class4 members#
public sealed class UnknownCommand : ZplCommandBase

Fallback for commands without a dedicated class.

Constructors

SignatureDescription
# UnknownCommand()
# UnknownCommand(string code)Fallback for commands without a dedicated class.

Properties

PropertyTypeDescription
Code { get; }string
Parameters { get; set; }string
UpcACommand ^BU – UPC-A. class7 members#
public sealed class UpcACommand : ZplCommandBase

^BU – UPC-A.

Constructors

SignatureDescription
# UpcACommand()

Properties

PropertyTypeDescription
AboveCode { get; set; }bool?
CheckDigit { get; set; }bool?
Code { get; }string
Height { get; set; }int?
Orientation { get; set; }ZplOrientation?
PrintInterpretation { get; set; }bool?
UpcECommand ^B9 – UPC-E. class7 members#
public sealed class UpcECommand : ZplCommandBase

^B9 – UPC-E.

Constructors

SignatureDescription
# UpcECommand()

Properties

PropertyTypeDescription
AboveCode { get; set; }bool?
CheckDigit { get; set; }bool?
Code { get; }string
Height { get; set; }int?
Orientation { get; set; }ZplOrientation?
PrintInterpretation { get; set; }bool?
UpcEanExtensionCommand ^BS – UPC/EAN extensions. class6 members#
public sealed class UpcEanExtensionCommand : ZplCommandBase

^BS – UPC/EAN extensions.

Constructors

SignatureDescription
# UpcEanExtensionCommand()

Properties

PropertyTypeDescription
AboveCode { get; set; }bool?
Code { get; }string
Height { get; set; }int?
Orientation { get; set; }ZplOrientation?
PrintInterpretation { get; set; }bool?
WriteConfigurationCommand ~WC – Print configuration label. class2 members#
public sealed class WriteConfigurationCommand : ZplCommandBase

~WC – Print configuration label.

Constructors

SignatureDescription
# WriteConfigurationCommand()

Properties

PropertyTypeDescription
Code { get; }string
ZplBuilder Fluent ZPL builder: new ZplBuilder().Format(f => f.FieldOrigin(10, 10).Font("0", 30, 30).FieldData("Hi")… class5 members#
public sealed class ZplBuilder

Fluent ZPL builder: new ZplBuilder().Format(f => f.FieldOrigin(10, 10).Font("0", 30, 30).FieldData("Hi")).ToString().

Constructors

SignatureDescription
# ZplBuilder()

Properties

PropertyTypeDescription
Document { get; }ZplDocument

Methods

Method SignatureReturnsDescription
# Format(Action<ZplFormatBuilder> build)ZplBuilderAdds a ^XA…^XZ label format.
# Raw(params ZplCommandBase[] commands)ZplBuilderAdds commands outside a label format (e.g. ~DG downloads, ~HS).
# ToString()string
ZplCommand A single ZPL command, e.g. ^FO50,100 → Prefix '^', Name "FO", Parameters "50,100". record8 members#
public record ZplCommand

A single ZPL command, e.g. ^FO50,100 → Prefix '^', Name "FO", Parameters "50,100".

Constructors

SignatureDescription
# ZplCommand(char Prefix, string Name, string Parameters)A single ZPL command, e.g. ^FO50,100 → Prefix '^', Name "FO", Parameters "50,100".

Properties

PropertyTypeDescription
Length { get; init; }intLength of the command in the source, prefix and parameters included.
Name { get; init; }string
Offset { get; init; }intCharacter offset of the command prefix in the parsed source (-1 when not parsed from text).
Parameters { get; init; }string
Prefix { get; init; }char

Methods

Method SignatureReturnsDescription
# Args(char delimiter = ',')string[]Parameters split at the current delimiter (default ',').
# Deconstruct(out char Prefix, out string Name, out string Parameters)void
ZplCommandBase Base class of all typed ZPL commands. Parameters are stored positionally (lossless) and exposed by derived classes as named, ty… class9 members#
public abstract class ZplCommandBase

Base class of all typed ZPL commands. Parameters are stored positionally (lossless) and exposed by derived classes as named, typed properties. A null property value means "parameter omitted" (printer default).

Properties

PropertyTypeDescription
Arguments { get; }IReadOnlyList<string>Raw positional arguments (as parsed, delimiter normalized to ',').
Code { get; }stringCommand mnemonic without prefix, e.g. "FO", "BC", "A".
ParameterText { get; set; }stringThe parameter text after the mnemonic.
Prefix { get; set; }char'^' or '~'.

Methods

Method SignatureReturnsDescription
static # From(ZplCommand raw)ZplCommandBaseCreates a typed command from a tokenized one (unknown mnemonics yield UnknownCommand).
# GetRaw(int i)string
# SetRaw(int i, string value)void
# ToString()stringSerializes with the standard control characters.
# ToString(char caret, char tilde, char delimiter)stringSerializes with the given control characters (see ^CC, ^CT, ^CD).
ZplDocument Typed object model of a ZPL stream. class7 members#
public sealed class ZplDocument

Typed object model of a ZPL stream.

Constructors

SignatureDescription
# ZplDocument()

Properties

PropertyTypeDescription
Commands { get; }IEnumerable<ZplCommandBase>All commands of all formats in order.
Formats { get; }List<ZplFormat>
LabelFormats { get; }IEnumerable<ZplFormat>Only the ^XA…^XZ label formats.

Methods

Method SignatureReturnsDescription
static # Parse(string zpl)ZplDocument
# ToString()string
# ToZpl(ZplOutputOptions? options = default)stringSerializes the document in the layout of options (pretty-printed, minified …; null = like ZplDocument.ToString). The result parses to the same commands and renders pixel-identically.
ZplFieldInfo A variable ^FN field found by ZplFields.Find. record8 members#
public record ZplFieldInfo

A variable ^FN field found by ZplFields.Find.

Constructors

SignatureDescription
# ZplFieldInfo(int Number, string Prompt, string Value, string Format, int Offset, int Count)A variable ^FN field found by ZplFields.Find. Number: Field number (^FN1 → 1). · Prompt: Prompt text of the first ^FN with one (^FN1"Name" → "Name"), or null. · Value: Data that prints without an override: the ^XF data block value, else the ^FD default of the field (null when none). · Format: Name of the stored format (^DF) the field belongs to, or null for fields of an ordinary label. · Offset: Source offset of the first ^FN command with this number. · Count: Number of fields with this number (stored formats and labels, ^XF data blocks not counted).

Properties

PropertyTypeDescription
Count { get; init; }intNumber of fields with this number (stored formats and labels, ^XF data blocks not counted).
Format { get; init; }stringName of the stored format (^DF) the field belongs to, or null for fields of an ordinary label.
Number { get; init; }intField number (^FN1 → 1).
Offset { get; init; }intSource offset of the first ^FN command with this number.
Prompt { get; init; }stringPrompt text of the first ^FN with one (^FN1"Name" → "Name"), or null.
Value { get; init; }stringData that prints without an override: the ^XF data block value, else the ^FD default of the field (null when none).

Methods

Method SignatureReturnsDescription
# Deconstruct(out int Number, out string Prompt, out string Value, out string Format, out int Offset, out int Count)void
ZplFields ^FN template helpers: list the variable fields of a ZPL job (for forms) and produce a "filled" job in which every ^FN… class2 members#
public static class ZplFields

^FN template helpers: list the variable fields of a ZPL job (for forms) and produce a "filled" job in which every ^FN field carries its data as ^FD and ^DF/^XF formats are merged into plain labels. Rendering with ZplRenderSettings.FieldValues gives the same image as rendering the filled job.

Methods

Method SignatureReturnsDescription
static # Fill(string zpl, IReadOnlyDictionary<int, string>? values = default)stringReturns the job with ^FN fields filled: values (and the ^XF data) become ^FD data of the fields, formats recalled with ^XF are expanded in place with the stored ^DF content, and the ^DF downloads are dropped. ^FN data merges as on a Zebra printer (see ZplRenderer): a field with ^FN n and data fills the earlier fields of n without data, with its own ^FH; data no field waits for (a ^FD default in the stored format, data before the ^XF) stays an ordinary field. Labels without ^FN merges are copied unchanged. Values containing ^ or ~ are written with ^FH hex escapes.
static # Find(string zpl)IReadOnlyList<ZplFieldInfo>All ^FN field numbers of a ZPL job in source order (^DF formats, ^XF data blocks and ordinary labels).
ZplFormat One label format (^XA … ^XZ) or a run of commands outside any format. class5 members#
public sealed class ZplFormat

One label format (^XA … ^XZ) or a run of commands outside any format.

Constructors

SignatureDescription
# ZplFormat()

Properties

PropertyTypeDescription
Commands { get; }List<ZplCommandBase>
IsLabelFormat { get; }boolTrue when the commands are enclosed by ^XA/^XZ.

Methods

Method SignatureReturnsDescription
# OfType<T>()IEnumerable<T>
# ToString()string
ZplFormatBuilder Builds the commands of one label format. Field-producing methods close the field with ^FS when data is given. class26 members#
public sealed class ZplFormatBuilder

Builds the commands of one label format. Field-producing methods close the field with ^FS when data is given.

Constructors

SignatureDescription
# ZplFormatBuilder(ZplFormat format)Builds the commands of one label format. Field-producing methods close the field with ^FS when data is given.

Properties

PropertyTypeDescription
Format { get; }ZplFormat

Methods

Method SignatureReturnsDescription
# Add(ZplCommandBase command)ZplFormatBuilder
# BarcodeDefaults(int moduleWidth, double? ratio = default, int? height = default)ZplFormatBuilder
# Code128(int? height = default, bool? interpretation = default, bool? above = default, ZplOrientation orientation = ZplOrientation.Normal, char? mode = default)ZplFormatBuilder
# Code39(int? height = default, bool? interpretation = default, ZplOrientation orientation = ZplOrientation.Normal)ZplFormatBuilder
# Comment(string text)ZplFormatBuilder
# DataMatrix(int height, int quality = 200, ZplOrientation orientation = ZplOrientation.Normal)ZplFormatBuilder
# Ean13(int? height = default, ZplOrientation orientation = ZplOrientation.Normal)ZplFormatBuilder
# Encoding(int charset = 28)ZplFormatBuilder
# FieldBlock(int width, int lines = 1, int spacing = 0, char justification = 'L', int hanging = 0)ZplFormatBuilder
# FieldData(string data, bool separator = true)ZplFormatBuilder
# FieldHex(char indicator = '_')ZplFormatBuilder
# FieldOrigin(int x, int y, int? justification = default)ZplFormatBuilder
# FieldReverse()ZplFormatBuilder
# FieldSeparator()ZplFormatBuilder
# FieldTypeset(int x, int y, int? justification = default)ZplFormatBuilder
# Font(string name, int? height = default, int? width = default, ZplOrientation orientation = ZplOrientation.Normal)ZplFormatBuilder
# GraphicBox(int width, int height, int thickness = 1, char color = 'B', int rounding = 0)ZplFormatBuilder
# GraphicCircle(int diameter, int thickness = 1, char color = 'B')ZplFormatBuilder
# LabelHome(int x, int y)ZplFormatBuilder
# LabelLength(int length)ZplFormatBuilder
# PrintWidth(int width)ZplFormatBuilder
# QrCode(int magnification = 3, char errorCorrection = 'Q', int model = 2)ZplFormatBuilder
# Quantity(int quantity)ZplFormatBuilder
# Text(int x, int y, string text, string font = "0", int height = 30, int? width = default)ZplFormatBuilderConvenience: ^FO + ^A + ^FD + ^FS.
ZplOrientation Field / barcode orientation (N, R, I, B). enum4 members#
public enum ZplOrientation

Field / barcode orientation (N, R, I, B).

Values

NameValueDescription
Normal78
Rotated82
Inverted73
Bottom66
ZplOutputOptions How ZplDocument.ToZpl writes ZPL. Every layout keeps the command stream: the output parses to the same commands (generated ^FX … class10 members#
public sealed class ZplOutputOptions

How ZplDocument.ToZpl writes ZPL. Every layout keeps the command stream: the output parses to the same commands (generated ^FX comments aside) and renders pixel-identically. Field data (^FD/^FV) and graphic payloads are written exactly as parsed, and no whitespace is ever inserted after field data.

Constructors

SignatureDescription
# ZplOutputOptions()

Properties

PropertyTypeDescription
AddComments { get; set; }boolPretty-print only: inserts a ^FX comment describing each field (text, barcode, box … and its position).
FieldsOnOneLine { get; set; }boolPretty-print only: a whole field block on one line (^FO50,50^A0N,30,30^FDHi^FS) instead of one command per line.
Indent { get; set; }intSpaces per indentation level when pretty-printing (0–8, default 2).
static Minified { get; }ZplOutputOptionsSmallest output: no whitespace between commands and no ^FX comments.
Minify { get; set; }boolNo whitespace between commands (one label per line). Wins over ZplOutputOptions.PrettyPrint.
NewLine { get; set; }stringLine break written between lines (default "\n").
static Pretty { get; }ZplOutputOptionsOne command per line with indented field blocks.
PrettyPrint { get; set; }boolOne command per line, label contents and field blocks (^FO/^FT … ^FS) indented.
StripComments { get; set; }boolRemoves existing ^FX comments (printers ignore them).
ZplParser Tokenizes raw ZPL into commands. Handles caret/tilde/delimiter changes (^CC, ^CT, ^CD) and commands with non-standard name leng… class3 members#
public static class ZplParser

Tokenizes raw ZPL into commands. Handles caret/tilde/delimiter changes (^CC, ^CT, ^CD) and commands with non-standard name lengths (^A font, ^B barcodes, ^XA etc. are all two chars, except ^A which is followed by the font name directly).

Methods

Method SignatureReturnsDescription
static # DecodeFieldHex(string data, char indicator, Encoding encoding)stringDecodes ^FH hex escapes (default indicator '_') inside field data.
static # LineColumn(string source, int offset)(int, int)1-based line and column of a character offset in source (CR LF, LF and CR end a line).
static # Parse(string zpl)List<ZplCommand>

ZplCore.Printing #

38 types

Printer transports (TCP 9100, USB, Serial, Windows Spooler, CUPS), printer discovery, host status (~HS/~HI), and the stateful/chaos virtual printer (ZplVirtualPrinter).

CommunicationType How the printer is attached. enum8 members#
public enum CommunicationType

How the printer is attached.

Values

NameValueDescription
Network0
Serial1
Usb2
File3
WindowsDriver4
Cups5
Stream6
Parallel7
CupsPrinterConnection Sends raw data to a CUPS queue on macOS/Linux via lp -d <queue> -o raw. Write-only. class9 members#
public sealed class CupsPrinterConnection : IPrinterConnection, IAsyncDisposable

Sends raw data to a CUPS queue on macOS/Linux via lp -d <queue> -o raw. Write-only.

Constructors

SignatureDescription
# CupsPrinterConnection(string queue, string lpPath = "lp")

Properties

PropertyTypeDescription
JobTitle { get; set; }string
LpPath { get; }string
Queue { get; }string

Methods

Method SignatureReturnsDescription
# BuildArguments()IReadOnlyList<string>The argument list passed to lp.
# DisposeAsync()ValueTask
static # IsValidQueueName(string queue)boolCUPS queue names may contain any printable character except space, tab, "/", "\", "#", quotes and control characters (lpadmin rules). A leading '-' is rejected so the name can't be taken as an lp option.
# QueryAsync(string command, TimeSpan timeout, CancellationToken ct = default)Task<string>Write-only transport: returns null without sending anything (a query must not end up as a print job).
# SendAsync(byte[] data, CancellationToken ct = default)Task
DiscoveredPrinter A locally attached printer found by PrinterDiscovery. record5 members#
public record DiscoveredPrinter

A locally attached printer found by PrinterDiscovery.

Constructors

SignatureDescription
# DiscoveredPrinter(string Name, string Address, PrinterSettings Settings)A locally attached printer found by PrinterDiscovery. Name: Display name (queue / spooler name or device file). · Address: Device path, spooler port or CUPS device URI. · Settings: Ready-to-use connection settings.

Properties

PropertyTypeDescription
Address { get; init; }stringDevice path, spooler port or CUPS device URI.
Name { get; init; }stringDisplay name (queue / spooler name or device file).
Settings { get; init; }PrinterSettingsReady-to-use connection settings.

Methods

Method SignatureReturnsDescription
# Deconstruct(out string Name, out string Address, out PrinterSettings Settings)void
DryRunPrinterConnection Dry-run connection (PrinterSettings.EnablePrinting = false): records everything that would be sent, prints nothing. Queries ret… class7 members#
public sealed class DryRunPrinterConnection : IPrinterConnection, IAsyncDisposable

Dry-run connection (PrinterSettings.EnablePrinting = false): records everything that would be sent, prints nothing. Queries return null.

Constructors

SignatureDescription
# DryRunPrinterConnection()

Properties

PropertyTypeDescription
Jobs { get; }IReadOnlyList<byte[]>Snapshot of the recorded jobs (one entry per SendAsync call).
Target { get; init; }stringOptional connection that would have been used (for diagnostics).
Text { get; }stringAll recorded data decoded as UTF-8.

Methods

Method SignatureReturnsDescription
# DisposeAsync()ValueTask
# QueryAsync(string command, TimeSpan timeout, CancellationToken ct = default)Task<string>
# SendAsync(byte[] data, CancellationToken ct = default)Task
IPrinterConnection A bidirectional (where supported) raw connection to a label printer. interface2 members#
public interface IPrinterConnection : IAsyncDisposable

A bidirectional (where supported) raw connection to a label printer.

Methods

Method SignatureReturnsDescription
# QueryAsync(string command, TimeSpan timeout, CancellationToken ct = default)Task<string>Sends a query command (e.g. "~HS") and returns the response, or null when the transport is write-only or nothing arrived in time.
# SendAsync(byte[] data, CancellationToken ct = default)TaskSends raw bytes (ZPL, EPL, graphics) to the printer.
JobOrientation Job orientation: rotates all fields without explicit orientation (^FW) or the whole format (^PO). enum4 members#
public enum JobOrientation

Job orientation: rotates all fields without explicit orientation (^FW) or the whole format (^PO).

Values

NameValueDescription
Portrait0
Landscape9090Fields rotated 90° clockwise (^FWR).
Portrait180180Format printed upside down (^POI).
Landscape270270Fields rotated 270° (^FWB).
MediaTracking Media sensing / tracking (^MN). enum5 members#
public enum MediaTracking

Media sensing / tracking (^MN).

Values

NameValueDescription
Continuous78Continuous media (no gaps); label length comes from ^LL.
Gap89Non-continuous web (gap/notch) sensing.
Mark77Non-continuous media, black mark sensing.
Auto65Auto-detect on calibration.
ContinuousVariable86Continuous media with variable length.
MediaType Media type (^MT). enum2 members#
public enum MediaType

Media type (^MT).

Values

NameValueDescription
ThermalTransfer84
DirectThermal68
ParallelPrinterConnection Parallel (Centronics/IEEE 1284) port. Writes to the port device: "LPT1".."LPT9" on Windows (or a spooler pr… class7 members#
public sealed class ParallelPrinterConnection : IPrinterConnection, IAsyncDisposable

Parallel (Centronics/IEEE 1284) port. Writes to the port device: "LPT1".."LPT9" on Windows (or a spooler printer shared on that port), /dev/lp0 / /dev/usb/lp0 on Linux; "LPTn" is mapped to /dev/lp{n-1} on Linux. Write-only.

Constructors

SignatureDescription
# ParallelPrinterConnection(string port = "LPT1")

Properties

PropertyTypeDescription
DevicePath { get; }stringThe device path written to.
Port { get; }string

Methods

Method SignatureReturnsDescription
# DisposeAsync()ValueTask
# QueryAsync(string command, TimeSpan timeout, CancellationToken ct = default)Task<string>
static # ResolveDevicePath(string port, bool windows)stringMaps "LPTn" to the OS device path.
# SendAsync(byte[] data, CancellationToken ct = default)Task
PrintMode Post-print action (^MM). enum9 members#
public enum PrintMode

Post-print action (^MM).

Values

NameValueDescription
TearOff84
PeelOff80
Rewind82
Applicator65
Cutter67
DelayedCutter68
Rfid70
Linerless76
Kiosk75
PrinterConnectionExtensions Convenience extensions for IPrinterConnection. class3 members#
public static class PrinterConnectionExtensions

Convenience extensions for IPrinterConnection.

Methods

Method SignatureReturnsDescription
extension # GetStatusAsync(this IPrinterConnection c, TimeSpan? timeout = default, CancellationToken ct = default)Task<ZplPrinterStatus>Queries ~HS and parses it; null when the transport cannot read.
extension # SendAsync(this IPrinterConnection c, string zpl, Encoding? encoding = default, CancellationToken ct = default)Task
extension # SendAsync(this IPrinterConnection c, Label label, int dpi = 203, int copies = 1, CancellationToken ct = default)Task
PrinterConnectionFactory Creates the IPrinterConnection for a PrinterSettings. class1 member#
public static class PrinterConnectionFactory

Creates the IPrinterConnection for a PrinterSettings.

Methods

Method SignatureReturnsDescription
static # Create(PrinterSettings settings)IPrinterConnection
PrinterDiscovery Best-effort enumeration of USB-attached printers (no extra dependencies, no raw USB access). class2 members#
public static class PrinterDiscovery

Best-effort enumeration of USB-attached printers (no extra dependencies, no raw USB access).

Windows: spooler printers on USBnnn ports (printed through the spooler, datatype RAW). Linux: /dev/usb/lp* device files (usblp kernel driver) plus CUPS queues with usb:// devices. macOS: CUPS queues with usb:// devices (via lpstat -v).

Methods

Method SignatureReturnsDescription
static # FindUsbPrintersAsync(CancellationToken ct = default)Task<IReadOnlyList<DiscoveredPrinter>>
static # ParseLpstatDevices(string output)IReadOnlyList<(string, string)>Parses lpstat -v output ("device for QUEUE: URI").
PrinterSettings Connection settings; only the members relevant to PrinterSettings.CommunicationType are used. class17 members#
public sealed class PrinterSettings

Connection settings; only the members relevant to PrinterSettings.CommunicationType are used.

Constructors

SignatureDescription
# PrinterSettings()

Properties

PropertyTypeDescription
BaudRate { get; set; }int
CommunicationType { get; set; }CommunicationType
DataBits { get; set; }int
DevicePath { get; set; }stringUSB/File: device path (/dev/usb/lp0, \\.\USB001, file). Parallel: port ("LPT1") or device path (/dev/lp0).
EnablePrinting { get; set; }boolFalse = dry run: PrinterConnectionFactory.Create returns a DryRunPrinterConnection that only records the data (tests, demos, staging systems).
Handshake { get; set; }Handshake
Host { get; set; }string
Job { get; set; }ZplJobSettingsOptional print job settings (print mode, media tracking, media type, orientation) applied by ZplJobSettings.Apply.
Parity { get; set; }Parity
Port { get; set; }int
PrinterName { get; set; }stringWindowsDriver: installed printer name; Cups: queue name.
SerialPort { get; set; }string
StopBits { get; set; }StopBits
Stream { get; set; }StreamStream: caller-owned stream.
Timeout { get; set; }TimeSpan
UseDefaultPrinter { get; set; }boolWindowsDriver: use the Windows default printer when PrinterSettings.PrinterName is empty.
RawFilePrinterConnection Writes to a device path or file: /dev/usb/lp0, LPT1, \\.\USB001, a share, or a plain file. Write-only. class6 members#
public sealed class RawFilePrinterConnection : IPrinterConnection, IAsyncDisposable

Writes to a device path or file: /dev/usb/lp0, LPT1, \\.\USB001, a share, or a plain file. Write-only.

Constructors

SignatureDescription
# RawFilePrinterConnection(string path, bool append = true)Writes to a device path or file: /dev/usb/lp0, LPT1, \\.\USB001, a share, or a plain file. Write-only.

Properties

PropertyTypeDescription
Append { get; }bool
Path { get; }string

Methods

Method SignatureReturnsDescription
# DisposeAsync()ValueTask
# QueryAsync(string command, TimeSpan timeout, CancellationToken ct = default)Task<string>Device files are opened write-only; the query is sent but no response is read.
# SendAsync(byte[] data, CancellationToken ct = default)Task
SerialPrinterConnection RS-232 / virtual COM port connection (System.IO.Ports). Opens the port per call. class11 members#
public sealed class SerialPrinterConnection : IPrinterConnection, IAsyncDisposable

RS-232 / virtual COM port connection (System.IO.Ports). Opens the port per call.

Constructors

SignatureDescription
# SerialPrinterConnection(string portName, int baudRate = 9600, Parity parity = Parity.None, int dataBits = 8, StopBits stopBits = StopBits.One, Handshake handshake = Handshake.XOnXOff)

Properties

PropertyTypeDescription
BaudRate { get; }int
DataBits { get; }int
Handshake { get; }Handshake
Parity { get; }Parity
PortName { get; }string
StopBits { get; }StopBits
WriteTimeout { get; set; }TimeSpan

Methods

Method SignatureReturnsDescription
# DisposeAsync()ValueTask
# QueryAsync(string command, TimeSpan timeout, CancellationToken ct = default)Task<string>
# SendAsync(byte[] data, CancellationToken ct = default)Task
StreamPrinterConnection Writes to (and reads from) any caller-owned stream. class5 members#
public sealed class StreamPrinterConnection : IPrinterConnection, IAsyncDisposable

Writes to (and reads from) any caller-owned stream.

Constructors

SignatureDescription
# StreamPrinterConnection(Stream stream, bool leaveOpen = true)Writes to (and reads from) any caller-owned stream.

Properties

PropertyTypeDescription
Stream { get; }Stream

Methods

Method SignatureReturnsDescription
# DisposeAsync()ValueTask
# QueryAsync(string command, TimeSpan timeout, CancellationToken ct = default)Task<string>
# SendAsync(byte[] data, CancellationToken ct = default)Task
TcpPrinterConnection Raw TCP (port 9100) connection. Opens one socket per call, like ZplPrinterClient. class6 members#
public sealed class TcpPrinterConnection : IPrinterConnection, IAsyncDisposable

Raw TCP (port 9100) connection. Opens one socket per call, like ZplPrinterClient.

Constructors

SignatureDescription
# TcpPrinterConnection(ZplPrinterClient client)
# TcpPrinterConnection(string host, int port = 9100)

Properties

PropertyTypeDescription
Client { get; }ZplPrinterClientThe wrapped client (host, port, timeout, encoding).

Methods

Method SignatureReturnsDescription
# DisposeAsync()ValueTask
# QueryAsync(string command, TimeSpan timeout, CancellationToken ct = default)Task<string>
# SendAsync(byte[] data, CancellationToken ct = default)Task
VirtualCutEventArgs The cutter of ZplVirtualPrinter cut after a label. class4 members#
public sealed class VirtualCutEventArgs : EventArgs

The cutter of ZplVirtualPrinter cut after a label.

Constructors

SignatureDescription
# VirtualCutEventArgs(int labelIndex, ZplCutReason reason, int partialCutMm)The cutter of ZplVirtualPrinter cut after a label.

Properties

PropertyTypeDescription
LabelIndex { get; }intVirtualLabelEventArgs.Index of the label the cut follows.
PartialCutMm { get; }intKiosk partial cut: millimetres left uncut (0 = full cut).
Reason { get; }ZplCutReason
VirtualJobEventArgs Raw data received by ZplVirtualPrinter (one processed segment). class5 members#
public sealed class VirtualJobEventArgs : EventArgs

Raw data received by ZplVirtualPrinter (one processed segment).

Constructors

SignatureDescription
# VirtualJobEventArgs(int connectionId, EndPoint remote, byte[] data, bool isEpl)Raw data received by ZplVirtualPrinter (one processed segment).

Properties

PropertyTypeDescription
ConnectionId { get; }int
Data { get; }byte[]
IsEpl { get; }bool
RemoteEndPoint { get; }EndPoint
VirtualLabelEventArgs A label rendered by ZplVirtualPrinter. class9 members#
public sealed class VirtualLabelEventArgs : EventArgs

A label rendered by ZplVirtualPrinter.

Constructors

SignatureDescription
# VirtualLabelEventArgs(int connectionId, EndPoint remote, int index, byte[] data, string filePath)A label rendered by ZplVirtualPrinter.

Properties

PropertyTypeDescription
ConnectionId { get; }intSequential id of the TCP connection (one renderer/printer memory per connection).
Cut { get; init; }ZplLabelCutCut decision of the label (^MM / ^PQ rules, see ZplCutPlan); null for EPL or container formats.
Data { get; }byte[]Encoded image (PNG by default, see ZplVirtualPrinter.RenderSettings).
FilePath { get; }stringFile written to ZplVirtualPrinter.OutputDirectory, if any.
Index { get; }intRunning label number across the printer's lifetime.
RemoteEndPoint { get; }EndPoint
Rfid { get; init; }RfidLabelResultResult of the tag simulation for this label (ZplVirtualPrinter.RfidSimulator), null when off or not an RFID label.
Voided { get; init; }boolRFID encoding failed (ZplFaultKind.RfidVoid or the tag simulation): the label printed with VOID across it and is retried.
WindowsSpoolerPrinterConnection Raw printing through the Windows spooler (winspool.drv, datatype RAW) to an installed printer/driver. Write-only. class8 members#
public sealed class WindowsSpoolerPrinterConnection : IPrinterConnection, IAsyncDisposable

Raw printing through the Windows spooler (winspool.drv, datatype RAW) to an installed printer/driver. Write-only.

Constructors

SignatureDescription
# WindowsSpoolerPrinterConnection(string printerName, string documentName = "ZPL")

Properties

PropertyTypeDescription
DocumentName { get; }string
PrinterName { get; }string

Methods

Method SignatureReturnsDescription
# DisposeAsync()ValueTask
static # EnumeratePrinters()IReadOnlyList<(string, string)>Installed printers with their port names (e.g. "USB001", "LPT1:", "IP_10.0.0.5").
static # GetDefaultPrinterName()stringName of the Windows default printer, or null when none is set.
# QueryAsync(string command, TimeSpan timeout, CancellationToken ct = default)Task<string>Write-only transport: returns null without sending anything (a query must not end up as a print job).
# SendAsync(byte[] data, CancellationToken ct = default)Task
ZplChaosScript A chaos script: printer options and faults as JSON, e.g. for zplcore serve --chaos script.json. class12 members#
public sealed class ZplChaosScript

A chaos script: printer options and faults as JSON, e.g. for zplcore serve --chaos script.json.

Constructors

SignatureDescription
# ZplChaosScript()

Properties

PropertyTypeDescription
ConcurrentConnections { get; init; }bool?printer.concurrentConnections (ZplVirtualPrinter.ConcurrentConnections).
Cutter { get; init; }bool?printer.cutter (null = keep the render settings).
Faults { get; init; }IReadOnlyList<ZplFaultRule>
HonorPauseCount { get; init; }bool?
LabelPrintTime { get; init; }TimeSpan?
MemoryBytes { get; init; }long?
ReceiveBufferBytes { get; init; }int?
Seed { get; init; }int?
SilentHostStatusOnError { get; init; }bool?

Methods

Method SignatureReturnsDescription
# ApplyTo(ZplVirtualPrinter printer)voidApplies the printer options of the script to printer and loads the faults.
static # FromJson(string json)ZplChaosScriptParses the JSON (property names case-insensitive, fault kinds camelCase or PascalCase).
ZplExtendedStatus Parsed ~HQES (host query, extended status) response. record12 members#
public record ZplExtendedStatus

Parsed ~HQES (host query, extended status) response.

Constructors

SignatureDescription
# ZplExtendedStatus(bool HasErrors, ZplPrinterErrors Errors, long ErrorGroup2, bool HasWarnings, ZplPrinterWarnings Warnings, long WarningGroup2, string Raw)Parsed ~HQES (host query, extended status) response.

Properties

PropertyTypeDescription
ErrorGroup2 { get; init; }long
Errors { get; init; }ZplPrinterErrors
HasErrors { get; init; }bool
HasWarnings { get; init; }bool
IsReady { get; }bool
Raw { get; init; }string
WarningGroup2 { get; init; }long
Warnings { get; init; }ZplPrinterWarnings

Methods

Method SignatureReturnsDescription
static # CleanResponse(string raw)stringStrips STX/ETX framing and blank lines from a ~HQ response (e.g. ~HQSN serial number, ~HQOD odometer).
# Deconstruct(out bool HasErrors, out ZplPrinterErrors Errors, out long ErrorGroup2, out bool HasWarnings, out ZplPrinterWarnings Warnings, out long WarningGroup2, out string Raw)void
static # Parse(string raw)ZplExtendedStatusParses the ~HQES text ("ERRORS: 1 00000000 00000005", "WARNINGS: ...").
ZplFaultEventArgs Raised when a fault becomes active or is cleared. class4 members#
public sealed class ZplFaultEventArgs : EventArgs

Raised when a fault becomes active or is cleared.

Constructors

SignatureDescription
# ZplFaultEventArgs(ZplFaultKind kind, string cause, ZplFaultRule rule)Raised when a fault becomes active or is cleared.

Properties

PropertyTypeDescription
Cause { get; }stringWhat raised or cleared it: "api", "~PS", "^PQ pause", "trigger", "timeout", "memory" ...
Kind { get; }ZplFaultKind
Rule { get; }ZplFaultRuleThe scheduled rule, if any.
ZplFaultKind Printer conditions and communication faults simulated by ZplVirtualPrinter (ZplVirtualPrinter.Faults). enum22 members#
public enum ZplFaultKind

Printer conditions and communication faults simulated by ZplVirtualPrinter (ZplVirtualPrinter.Faults).

Values

NameValueDescription
PaperOut0Media out: ~HS paper out flag, ~HQES error 0x1. Labels stay in the buffer until cleared.
RibbonOut1Ribbon out: ~HS ribbon out flag, ~HQES error 0x2.
HeadOpen2Printhead open: ~HS head up flag, ~HQES error 0x4, SGD head.latch "open".
HeadOverTemperature3Printhead over temperature: ~HS over temperature flag, ~HQES error 0x10.
MotorOverTemperature4Motor over temperature: ~HQES error 0x20.
CutterFault5Cutter fault / jam: ~HQES error 0x8 (also raised for cutter modes when the printer has no cutter).
Pause6Pause (like ~PP or the PAUSE key): ~HS pause flag, ~HQES error 0x10000; cleared by ~PS.
HeadUnderTemperature7Printhead under temperature: ~HS under temperature flag (the printer keeps printing).
CorruptRam8Corrupt RAM (configuration data lost): ~HS flag j.
PaperNearEnd9Paper near end: ~HQES warning 0x8.
CleanPrinthead10Clean printhead: ~HQES warning 0x2.
ReplacePrinthead11Replace printhead: ~HQES warning 0x4.
BufferFull12Receive buffer full: ~HS buffer full flag; the printer stops reading from the socket (TCP back-pressure).
OutOfMemory13Printer memory full: ~DG/~DY/~DU/^DF downloads are rejected (also raised as an event when the memory is exhausted).
RfidVoid14RFID encode error: labels with ^RF/^WT/^RQ print VOID and are retried (^RS n tries, error handling e).
DropLabels15Labels are lost: rendered but not printed (LabelDropped).
Disconnect16Connection reset (RST): with ZplFaultTrigger.AfterBytes exactly at that byte (the rest of the job is lost), otherwise all open connections.
CommunicationTimeout17Communication timeout: the printer neither reads nor answers (connections stay open).
Latency18Every response is delayed by ZplFaultRule.Delay.
SlowReceive19Data is read at ZplFaultRule.BytesPerSecond (slow printer, host writes block).
PartialWrites20Responses are written in pieces of ZplFaultRule.ChunkSize bytes with ZplFaultRule.Delay in between.
PowerOff21Printer switched off: connections are reset, new connections refused, the buffer is lost; clearing powers it on again.
ZplFaultRule A scheduled fault: what (ZplFaultRule.Kind), when (ZplFaultRule.Trigger) and how long. record10 members#
public record ZplFaultRule

A scheduled fault: what (ZplFaultRule.Kind), when (ZplFaultRule.Trigger) and how long.

Constructors

SignatureDescription
# ZplFaultRule(ZplFaultKind Kind, ZplFaultTrigger Trigger)A scheduled fault: what (ZplFaultRule.Kind), when (ZplFaultRule.Trigger) and how long.

Properties

PropertyTypeDescription
BytesPerSecond { get; init; }intZplFaultKind.SlowReceive: receive rate.
ChunkSize { get; init; }intZplFaultKind.PartialWrites: bytes per write.
ClearAfter { get; init; }TimeSpan?Clears the condition automatically after this time (null: until ZplPrinterFaults.Clear, ~PS for Pause).
ClearAfterLabels { get; init; }int?ZplFaultKind.DropLabels / ZplFaultKind.RfidVoid: clears after this many affected labels.
Delay { get; init; }TimeSpanLatency per response, or pause between partial writes.
Kind { get; init; }ZplFaultKind
Repeat { get; init; }boolZplFaultTriggerKind.OnCommand / ZplFaultTriggerKind.Random: fire every time instead of once.
Trigger { get; init; }ZplFaultTrigger

Methods

Method SignatureReturnsDescription
# Deconstruct(out ZplFaultKind Kind, out ZplFaultTrigger Trigger)void
ZplFaultTrigger Trigger of a ZplFaultRule; counts start when the rule is scheduled. record14 members#
public record ZplFaultTrigger

Trigger of a ZplFaultRule; counts start when the rule is scheduled.

Constructors

SignatureDescription
# ZplFaultTrigger(ZplFaultTriggerKind Kind, long Count = 0, string? Command = default, TimeSpan Time = default, double Probability = 0)Trigger of a ZplFaultRule; counts start when the rule is scheduled.

Properties

PropertyTypeDescription
Command { get; init; }string
Count { get; init; }long
static Immediately { get; }ZplFaultTrigger
Kind { get; init; }ZplFaultTriggerKind
Probability { get; init; }double
Time { get; init; }TimeSpan

Methods

Method SignatureReturnsDescription
static # After(TimeSpan time)ZplFaultTrigger
static # AfterBytes(long bytes)ZplFaultTrigger
static # AfterCuts(long cuts)ZplFaultTrigger
static # AfterLabels(long labels)ZplFaultTrigger
# Deconstruct(out ZplFaultTriggerKind Kind, out long Count, out string Command, out TimeSpan Time, out double Probability)void
static # OnCommand(string command)ZplFaultTriggerA command with prefix, e.g. "~JA", "^RF", "^XZ" (case-insensitive).
static # Random(double probability)ZplFaultTriggerFires before a label with probability probability (0..1).
ZplFaultTriggerKind When a scheduled fault fires. enum7 members#
public enum ZplFaultTriggerKind

When a scheduled fault fires.

Values

NameValueDescription
Immediately0Now.
AfterLabels1After n more labels have been printed.
AfterBytes2After n more bytes have been received.
AfterCuts3After n more cuts.
OnCommand4When a command (e.g. "~JA", "^RF", "^XZ") is received, before the format containing it prints.
AfterTime5After a time span.
Random6Before each label with a probability (seeded by ZplPrinterFaults.Seed).
ZplHostQueryExtensions ~HQ host query extensions. class4 members#
public static class ZplHostQueryExtensions

~HQ host query extensions.

Methods

Method SignatureReturnsDescription
extension # GetExtendedStatusAsync(this IPrinterConnection c, TimeSpan? timeout = default, CancellationToken ct = default)Task<ZplExtendedStatus>Queries ~HQES and parses error/warning flags; null when the transport can't read.
extension # GetOdometerAsync(this IPrinterConnection c, TimeSpan? timeout = default, CancellationToken ct = default)Task<string>~HQOD: odometer text (printed length since manufacture / resets).
extension # GetPrinterInfoAsync(this IPrinterConnection c, TimeSpan? timeout = default, CancellationToken ct = default)Task<string>~HI: printer identification ("model,firmware,dpmm,memory,options").
extension # GetSerialNumberAsync(this IPrinterConnection c, TimeSpan? timeout = default, CancellationToken ct = default)Task<string>~HQSN: printer serial number.
ZplJobSettings Printer job settings injected at the start of each label format: print mode, media tracking, media type, orientation, darkness … class13 members#
public sealed class ZplJobSettings

Printer job settings injected at the start of each label format: print mode, media tracking, media type, orientation, darkness and speed. Unset (null) values are not sent, so the printer keeps its configuration.

Constructors

SignatureDescription
# ZplJobSettings()

Properties

PropertyTypeDescription
Darkness { get; set; }int?Darkness (^MD, -30..30, relative).
MarkOffset { get; set; }int?Black mark offset in dots (^MNM,offset; -80..283).
MaximumLabelLength { get; set; }int?Maximum label length in dots for calibration (^ML).
MediaLength { get; set; }int?Label length in dots (^LL), e.g. the form length for continuous media or the mark-to-mark distance.
MediaTracking { get; set; }MediaTracking?
MediaType { get; set; }MediaType?
Orientation { get; set; }JobOrientation
PrePeel { get; set; }bool?^MM second parameter: pre-peel (peel-off mode only).
PrintMode { get; set; }PrintMode?
PrintSpeed { get; set; }int?Print speed in inches per second (^PR).

Methods

Method SignatureReturnsDescription
# Apply(string zpl)stringInserts ZplJobSettings.ToZpl after every ^XA of zpl (assumes the default ^ caret).
# ToZpl()stringThe commands for one format (to insert right after ^XA).
ZplPrinterClient Sends ZPL to a network printer (raw TCP, port 9100) or any stream (USB/serial adapters). class11 members#
public sealed class ZplPrinterClient

Sends ZPL to a network printer (raw TCP, port 9100) or any stream (USB/serial adapters).

Constructors

SignatureDescription
# ZplPrinterClient(string host, int port = 9100)Sends ZPL to a network printer (raw TCP, port 9100) or any stream (USB/serial adapters).

Properties

PropertyTypeDescription
Encoding { get; set; }EncodingEncoding for the ZPL bytes. Use UTF-8 together with ^CI28 (the label model does).
Host { get; }string
Port { get; }int
Timeout { get; set; }TimeSpan

Methods

Method SignatureReturnsDescription
# AsConnection()IPrinterConnectionThis client as an IPrinterConnection.
# GetStatusAsync(CancellationToken ct = default)Task<ZplPrinterStatus>Queries ~HS and parses the response.
# SendAsync(string zpl, CancellationToken ct = default)Task
# SendAsync(Label label, int dpi = 203, int copies = 1, CancellationToken ct = default)Task
static # SendAsync(Stream stream, string zpl, Encoding? encoding = default, CancellationToken ct = default)TaskWrites ZPL to an arbitrary stream (file, serial port, USB device handle).
# SendBytesAsync(byte[] data, CancellationToken ct = default)TaskSends raw bytes over one TCP connection.
ZplPrinterErrors Error flags of the ~HQES response (nibbles 8-1), ZPL II Programming Guide P1134473-11EN, ~HQ Table 8 "Error Flags". V… enum19 members#
public enum ZplPrinterErrors

Error flags of the ~HQES response (nibbles 8-1), ZPL II Programming Guide P1134473-11EN, ~HQ Table 8 "Error Flags". Values marked KR403 are only reported by KR403 kiosk printers.

Values [Flags]

NameValueDescription
None0
MediaOut0x1
RibbonOut0x2
HeadOpen0x4
CutterFault0x8
PrintheadOverTemperature0x10
MotorOverTemperature0x20
BadPrintheadElement0x40
PrintheadDetectionError0x80
InvalidFirmwareConfiguration0x100
PrintheadThermistorOpen0x200
PaperJam0x1000Paper jam during retract (KR403).
PresenterNotRunning0x2000Presenter not running (KR403).
PaperFeedError0x4000Paper feed error (KR403).
ClearPaperPathFailed0x8000Clear paper path failed (KR403).
Paused0x10000The printer is paused.
RetractTimedOut0x20000Retract function timed out (KR403).
BlackMarkCalibrateError0x40000Black mark calibrate error (KR403).
BlackMarkNotFound0x80000Black mark not found (KR403).
ZplPrinterFaults Scriptable faults and printer conditions of a ZplVirtualPrinter: set conditions now (ZplPrinterFaults.Raise), schedule them det… class14 members#
public sealed class ZplPrinterFaults

Scriptable faults and printer conditions of a ZplVirtualPrinter: set conditions now (ZplPrinterFaults.Raise), schedule them deterministically (ZplPrinterFaults.Schedule: after n labels, bytes or cuts, on a command, after a time, or randomly with ZplPrinterFaults.Seed) and clear them like an operator (ZplPrinterFaults.Clear). Thread-safe.

Properties

PropertyTypeDescription
Active { get; }IReadOnlyCollection<ZplFaultKind>Active conditions.
Scheduled { get; }IReadOnlyList<ZplFaultRule>Scheduled rules that have not fired yet (and repeating rules).
Seed { get; set; }intSeed of the random triggers (default 0): the same seed and job give the same faults.
StopsPrinting { get; }boolPrinting is stopped (paper/ribbon out, head open, over temperature, cutter fault, pause, power off).

Methods

Method SignatureReturnsDescription
# ActiveRule(ZplFaultKind kind)ZplFaultRuleThe rule that activated kind (null when raised without rule or inactive).
# Clear(ZplFaultKind kind)voidClears a condition (paper loaded, head closed, cooled down, ~PS for Pause ...).
# ClearAll()voidClears all conditions and removes all scheduled rules.
# IsActive(ZplFaultKind kind)bool
# Load(ZplChaosScript script)voidLoads a chaos script (see ZplChaosScript) and schedules its faults.
# Raise(ZplFaultKind kind)voidActivates a condition now (like a sensor or the operator).
# Schedule(ZplFaultRule rule)ZplFaultRuleSchedules a rule; ZplFaultTriggerKind.Immediately activates it at once.
# Schedule(ZplFaultKind kind, ZplFaultTrigger trigger)ZplFaultRule

Events

EventHandler TypeDescription
FaultClearedEventHandler<ZplFaultEventArgs>
FaultRaisedEventHandler<ZplFaultEventArgs>
ZplPrinterStatus Parsed ~HS host status response (ZPL II Programming Guide, "~HS Host Status Return"): String 1 aaa,b,c,dddd,eee,f,g,h… record21 members#
public record ZplPrinterStatus

Parsed ~HS host status response (ZPL II Programming Guide, "~HS Host Status Return"): String 1 aaa,b,c,dddd,eee,f,g,h,iii,j,k,l, String 2 mmm,n,o,p,q,r,s,t,uuuuuuuu,v,www, String 3 xxxx,y.

Constructors

SignatureDescription
# ZplPrinterStatus(bool PaperOut, bool Paused, bool HeadOpen, bool RibbonOut, bool OverTemperature, bool UnderTemperature, int LabelsRemainingInBatch, int FormatsInBuffer, string Raw)Parsed ~HS host status response (ZPL II Programming Guide, "~HS Host Status Return"): String 1 aaa,b,c,dddd,eee,f,g,h,iii,j,k,l, String 2 mmm,n,o,p,q,r,s,t,uuuuuuuu,v,www, String 3 xxxx,y.

Properties

PropertyTypeDescription
BufferFull { get; init; }boolf: receive buffer full.
CorruptRam { get; init; }boolj: corrupt RAM (configuration data lost).
FormatsInBuffer { get; init; }int
GraphicsStored { get; init; }intwww: number of graphic images stored in memory.
HeadOpen { get; init; }bool
IsReady { get; }bool
LabelLength { get; init; }intdddd: label length in dots.
LabelWaiting { get; init; }boolt: label waiting (peel-off mode).
LabelsRemainingInBatch { get; init; }int
OverTemperature { get; init; }bool
PaperOut { get; init; }bool
PartialFormat { get; init; }boolh: partial format in progress (a format was started but its ^XZ has not arrived).
Paused { get; init; }bool
PrintModeCode { get; init; }stringr: print mode code (0 Rewind, 1 Peel-Off, 2 Tear-Off, 3 Cutter, 4 Applicator, 5 Delayed cut, ... 9 RFID, K Kiosk).
Raw { get; init; }string
RibbonOut { get; init; }bool
ThermalTransfer { get; init; }boolq: thermal transfer mode selected.
UnderTemperature { get; init; }bool

Methods

Method SignatureReturnsDescription
# Deconstruct(out bool PaperOut, out bool Paused, out bool HeadOpen, out bool RibbonOut, out bool OverTemperature, out bool UnderTemperature, out int LabelsRemainingInBatch, out int FormatsInBuffer, out string Raw)void
static # Parse(string raw)ZplPrinterStatusParses the three STX…ETX strings returned by ~HS.
ZplPrinterWarnings Warning flags of the ~HQES response (nibbles 8-1), ~HQ Table 9 "Warning Flags" (sensor flags: KR403). enum13 members#
public enum ZplPrinterWarnings

Warning flags of the ~HQES response (nibbles 8-1), ~HQ Table 9 "Warning Flags" (sensor flags: KR403).

Values [Flags]

NameValueDescription
None0
NeedToCalibrateMedia0x1
CleanPrinthead0x2
ReplacePrinthead0x4
PaperNearEnd0x8
Sensor1PaperBeforeHead0x10Sensor 1 (paper before head).
Sensor2BlackMark0x20Sensor 2 (black mark).
Sensor3PaperAfterHead0x40Sensor 3 (paper after head).
Sensor4LoopReady0x80Sensor 4 (loop ready).
Sensor5Presenter0x100Sensor 5 (presenter).
Sensor6RetractReady0x200Sensor 6 (retract ready).
Sensor7InRetract0x400Sensor 7 (in retract).
Sensor8AtBin0x800Sensor 8 (at bin).
ZplVirtualPrinter Virtual network label printer: a TCP listener (raw port 9100 protocol) that accepts ZPL or EPL jobs, renders them with ZplRende… class32 members#
public sealed class ZplVirtualPrinter : IAsyncDisposable

Virtual network label printer: a TCP listener (raw port 9100 protocol) that accepts ZPL or EPL jobs, renders them with ZplRenderer / EplRenderer (one per connection, i.e. its own printer memory), raises LabelReceived and optionally writes the images to ZplVirtualPrinter.OutputDirectory.

Chaos printer: ZplVirtualPrinter.Faults simulates printer conditions (paper/ribbon out, head open, over/under temperature, pause, buffer full, out of memory, cutter fault, RFID void) and communication faults (disconnect after n bytes, communication timeout, latency, slow receive, partial writes, power off), set directly or scheduled deterministically (after n labels/bytes/cuts, on a command, after a time, seeded random). They show on the wire like on a Zebra printer: labels stay in the buffer while printing is stopped, ~HS, ~HQES and SGD device.host_status / head.latch report the flags, a full buffer stops reading the socket. Recovery per the ZPL manual: ~PS resumes from pause, ~JA cancels all buffered formats, ~JP cancels the next format and pauses, ~JR resets (buffer cleared, pause off; physical conditions remain until cleared), ~JK cuts in delayed cut mode. Behaviour and manual references: docs-internal/chaos-printer.md.Host queries ~HS, ~HI, ~HM and ~HQ (ES, SN, OD, PH) are answered from the simulated state; ZplVirtualPrinter.HostQueryHandler overrides them.Connections are accepted concurrently but their data is processed one connection at a time, like on a Zebra printer with its single print engine ("first come and first served"; a connection that has sent half a format keeps the others waiting until the format is complete, the connection closes or ZplVirtualPrinter.IdleTimeout ends it). ZplVirtualPrinter.ConcurrentConnections restores processing every connection in parallel (load tests).

Constructors

SignatureDescription
# ZplVirtualPrinter(int port = 9100, IPAddress? address = default)port: TCP port (0 = any free port, see ZplVirtualPrinter.Port after ZplVirtualPrinter.Start). · address: Listen address (default: loopback; use IPAddress.Any for the network).

Properties

PropertyTypeDescription
ConcurrentConnections { get; set; }boolProcess the data of all connections in parallel (behaviour of earlier versions, for load tests). Default false: like a Zebra printer, connections are accepted at the same time but served one after the other, first come first served – a connection holds the printer from its first data until it has no incomplete format left (Zebra developer forum: "only one print engine … taken on a first come and first served basis"; PrintSecure guide P1099957: the raw ports allow multiple connections served first come first served, ip.port_single_conn refuses a second one).
Faults { get; }ZplPrinterFaultsPrinter conditions and communication faults (chaos printer).
Firmware { get; set; }string
HonorPauseCount { get; set; }bool^PQ p with o = N pauses the printer after every group of p labels, like a Zebra printer (resume with ~PS). Default false: such jobs print through (behaviour of earlier versions).
HostQueryHandler { get; set; }Func<string, string>Custom host query answers: gets the command (e.g. "~HQES"), returns the response or null for the default.
IdleTimeout { get; set; }TimeSpanCloses a connection without data for this long (default 60 s).
IsRunning { get; }bool
LabelPrintTime { get; set; }TimeSpanTime to print one label (default 0: instantly). With a print time the printer works through its buffer in the background, so ~JA/~JP can cancel labels that have not printed yet and ~HS reports the labels remaining.
MaxJobBytes { get; set; }intUpper bound of buffered unprocessed data per connection (default 64 MB).
MemoryBytes { get; set; }longPrinter memory for downloads (~DG, ~DY, ~DU, ^DF) per connection in bytes; 0 = default of ZplResourceStore.MaxTotalBytes. Reported by ~HM.
Model { get; set; }stringModel reported by ~HI.
OutputDirectory { get; set; }stringWhen set, each rendered label is saved here ("label-yyyyMMdd-HHmmss-n.png").
Port { get; }intThe bound port (valid after ZplVirtualPrinter.Start).
Profile { get; }PrinterProfileThe profile applied with ZplVirtualPrinter.ApplyProfile, null for the generic virtual printer.
ReceiveBufferBytes { get; set; }intReceive buffer: while the formats waiting to print hold this many bytes, the buffer-full flag is set and the printer stops reading (0 = unlimited).
RenderSettings { get; init; }ZplRenderSettingsRender settings used for each new connection (dpi, label size, output format PNG/PDF/..., ZplRenderSettings.CutterInstalled).
RfidSimulator { get; set; }ZplRfidSimulatorRFID tag simulation (default null: off). When set, each label with RFID commands is encoded into a simulated Gen2 tag from ZplRfidSimulator.NextTag; a failed encoding or read-back voids the label like ZplFaultKind.RfidVoid (^RS tries and error handling). ^HV responses are sent to the host. ~RVE / ~RVD report "_+,n_" / "_-,n_" per RFID label with or without simulation.
SerialNumber { get; set; }string
SilentHostStatusOnError { get; set; }boolNo ~HS / device.host_status answer while media out, ribbon out, head open or head over temperature (note in the 2026 ZPL manual, ~HS). Default false: answered with the flags set, as the older manual and the Link-OS SDK expect.
TimeProvider { get; init; }TimeProviderClock of the simulation (default TimeProvider.System): ZplVirtualPrinter.LabelPrintTime, fault timers (ZplFaultTrigger.After, ZplFaultRule.ClearAfter), latency, slow receive and partial writes wait on it. A manual clock (e.g. FakeTimeProvider) makes timed scenarios deterministic in tests.

Methods

Method SignatureReturnsDescription
# ApplyProfile(PrinterProfile profile)ZplVirtualPrinterMakes the virtual printer behave like profile (call before ZplVirtualPrinter.Start): resolution, label width = printhead width, cutter as installed (PrinterProfile.InstalledOptions; cutter mode on a printer without cutter raises a cutter fault), download memory = user RAM + user flash, and the identity answers: ~HI "model,firmware,dots/mm,RAM KB," and SGD getvar device.product_name, appl.name, head.resolution.in_dpi, ezpl.print_width, device.languages, device.unique_id, device.host_identification. An existing ZplVirtualPrinter.HostQueryHandler keeps priority. Values that the profile does not know keep the defaults. See docs-internal/printer-twin.md for which parts of these answers are documented and which are assumptions.
# DisposeAsync()ValueTask
# GetStatus()ZplVirtualPrinterStatusSnapshot of the simulated printer: conditions, buffer, counters and the current ~HS / ~HQES answers.
# Start()void
# StopAsync()Task
# WaitForIdleAsync(TimeSpan timeout)Task<bool>Waits until the buffer is empty and no label is printing (or printing is stopped by a condition); false on timeout.

Events

EventHandler TypeDescription
ErrorEventHandler<Exception>Raised when a connection fails (bad data, renderer errors, IO); the listener keeps running.
JobReceivedEventHandler<VirtualJobEventArgs>
LabelCutEventHandler<VirtualCutEventArgs>The cutter cut after a label (cutter, delayed cut with ~JK, kiosk ^CN, RFID void with ^PQ e).
LabelDroppedEventHandler<VirtualLabelEventArgs>A label was lost (ZplFaultKind.DropLabels): rendered but not printed.
LabelReceivedEventHandler<VirtualLabelEventArgs>
ZplVirtualPrinterStatus Snapshot of the simulated printer (ZplVirtualPrinter.GetStatus). record13 members#
public record ZplVirtualPrinterStatus

Snapshot of the simulated printer (ZplVirtualPrinter.GetStatus).

Constructors

SignatureDescription
# ZplVirtualPrinterStatus(IReadOnlyCollection<ZplFaultKind> Conditions, bool CanPrint, int LabelsQueued, int FormatsQueued, long LabelsPrinted, long Cuts, long LabelsVoided, long LabelsDropped, ZplPrintMode PrintMode, string HostStatus, string ExtendedStatus)Snapshot of the simulated printer (ZplVirtualPrinter.GetStatus).

Properties

PropertyTypeDescription
CanPrint { get; init; }bool
Conditions { get; init; }IReadOnlyCollection<ZplFaultKind>
Cuts { get; init; }long
ExtendedStatus { get; init; }string
FormatsQueued { get; init; }int
HostStatus { get; init; }string
LabelsDropped { get; init; }long
LabelsPrinted { get; init; }long
LabelsQueued { get; init; }int
LabelsVoided { get; init; }long
PrintMode { get; init; }ZplPrintMode

Methods

Method SignatureReturnsDescription
# Deconstruct(out IReadOnlyCollection<ZplFaultKind> Conditions, out bool CanPrint, out int LabelsQueued, out int FormatsQueued, out long LabelsPrinted, out long Cuts, out long LabelsVoided, out long LabelsDropped, out ZplPrintMode PrintMode, out string HostStatus, out string ExtendedStatus)void

ZplCore.Rendering #

6 types

Rendered element trace, pixel comparison (ImageCompare), and vector output capture.

BitmapFont Downloaded bitmap font (~DB): fixed-size glyph bitmaps, magnified by integer factors. class6 members#
public sealed class BitmapFont

Downloaded bitmap font (~DB): fixed-size glyph bitmaps, magnified by integer factors.

Constructors

SignatureDescription
# BitmapFont()

Properties

PropertyTypeDescription
Baseline { get; init; }int
Glyphs { get; }Dictionary<int, BitmapFont.Glyph>
Height { get; init; }int
SpaceWidth { get; init; }int
Width { get; init; }int
BitmapFont.Glyph record9 members#
public record BitmapFont.Glyph

Constructors

SignatureDescription
# Glyph(int Height, int Width, int OffsetX, int OffsetY, int Advance, byte[] Bits)

Properties

PropertyTypeDescription
Advance { get; init; }int
Bits { get; init; }byte[]
BytesPerRow { get; }int
Height { get; init; }int
OffsetX { get; init; }int
OffsetY { get; init; }int
Width { get; init; }int

Methods

Method SignatureReturnsDescription
# Deconstruct(out int Height, out int Width, out int OffsetX, out int OffsetY, out int Advance, out byte[] Bits)void
FontDownloadCommand Printer command used to download a TrueType font. enum2 members#
public enum FontDownloadCommand

Printer command used to download a TrueType font.

Values

NameValueDescription
DY0~DY (download objects, extension T) — current printers.
DU1~DU (download unbounded TrueType font) — older printers.
FontManager Maps ZPL font identifiers (0, A–Z, ^CW aliases, downloaded TTFs) to Skia typefaces. Zebra's resident fonts are proprietary, so … class16 members#
public sealed class FontManager

Maps ZPL font identifiers (0, A–Z, ^CW aliases, downloaded TTFs) to Skia typefaces. Zebra's resident fonts are proprietary, so embedded open fonts (DejaVu, free license) are used, which renders identically on every OS. Any font can be overridden with FontManager.RegisterFont.

Thread-safe (concurrent dictionaries); shared through ZplResourceStore.Fonts.

Constructors

SignatureDescription
# FontManager()

Properties

PropertyTypeDescription
static DefaultMono { get; }SKTypefaceBuilt-in monospace font (barcode texts, EPL/ZPL bitmap font replacement).
static DefaultSans { get; }SKTypefaceBuilt-in condensed sans font (replacement of Zebra font 0).
FontProvider { get; set; }Func<string, byte[]>Optional callback that supplies TrueType/OpenType data for fonts the label references but nobody registered (e.g. "E:ARIAL.TTF" in ^A@ or ^CW). Called at most once per name; return null when the font is unknown.
Fonts { get; }IReadOnlyCollection<string>
Mono { get; set; }SKTypefaceTypeface for the bitmap fonts A–H without a registered TTF.
Scalable { get; set; }SKTypefaceTypeface for font 0 and other scalable fonts without a registered TTF.
SystemFonts { get; set; }boolResolve names that are neither registered, downloaded nor supplied by FontManager.FontProvider as the family name of an installed system font (e.g. "Arial", "Arial Bold", "E:ARIAL.TTF") via SKFontManager.Default. Off for plain ZPL (a printer only knows its stored fonts); on for the label model (ZplRenderSettings.UseSystemFonts).

Methods

Method SignatureReturnsDescription
static # Convert(byte[] ttf, string name, FontDownloadCommand command = FontDownloadCommand.DY)stringConverts a TrueType/OpenType font file into the printer download command: ~DYd:NAME.TTF,A,T,size,,hex (FontDownloadCommand.DY) or ~DUd:NAME.TTF,size,hex (FontDownloadCommand.DU). name may include a drive ("E:ARIAL.TTF", default E:) and gets ".TTF" when it has no extension.
# LinkFont(string baseFont, string extensionFont, bool link = true)void^FL: links an extension font to a base font (used for characters missing in the base).
# RegisterBitmapFont(string name, BitmapFont font)voidRegisters a downloaded bitmap font (~DB) under a name like "R:MYFONT.FNT".
# RegisterFolder(string directory)voidRegisters every *.ttf/*.otf of a folder; the file name (e.g. "0.ttf", "ARIAL.TTF") is the font name.
# RegisterFont(string name, byte[] ttf)voidRegisters a TrueType/OpenType font under a ZPL name, e.g. "0", "A", or "E:ARIAL.TTF".
# RegisterFont(string name, SKTypeface typeface)void
# RemoveFont(string name)bool
# RenameFont(string name, string newName)boolRenames a registered TrueType font; false when name is unknown or newName exists.
ImageCompare Tolerant comparison of rendered labels (e.g. against reference renders of a real printer). class2 members#
public static class ImageCompare

Tolerant comparison of rendered labels (e.g. against reference renders of a real printer).

Methods

Method SignatureReturnsDescription
static # Compare(SKBitmap expected, SKBitmap actual, int tolerance = 2)ImageComparisonPrecision = share of ink in actual that has ink in expected within tolerance pixels; Recall = the same the other way round.
static # Diff(SKBitmap expected, SKBitmap actual)SKBitmapOverlay: black = both, red = only expected, blue = only actual.
ImageComparison Result of comparing two black/white label images. record9 members#
public record ImageComparison

Result of comparing two black/white label images.

Constructors

SignatureDescription
# ImageComparison(double Precision, double Recall, int OnlyA, int OnlyB, int InkA, int InkB)Result of comparing two black/white label images.

Properties

PropertyTypeDescription
InkA { get; init; }int
InkB { get; init; }int
OnlyA { get; init; }int
OnlyB { get; init; }int
Precision { get; init; }double
Recall { get; init; }double
Score { get; }doubleHarmonic mean of precision and recall (1 = identical within tolerance).

Methods

Method SignatureReturnsDescription
# Deconstruct(out double Precision, out double Recall, out int OnlyA, out int OnlyB, out int InkA, out int InkB)void

ZplCore.Rfid #

23 types

RFID Studio: EPC Tag Data Standard 2.0 codec (SGTIN-96/198, SSCC-96, GRAI, GIAI, SGLN, GSRN, GDTI, CPI, ADI, USDOD), ^RF parser, and tag memory simulator.

Epc An encoded or decoded EPC (GS1 EPC Tag Data Standard 2.3): the GS1 key it identifies, filter value, binary / hex encoding for t… class35 members#
public sealed class Epc

An encoded or decoded EPC (GS1 EPC Tag Data Standard 2.3): the GS1 key it identifies, filter value, binary / hex encoding for the EPC memory bank and the URI forms. Created by ZplRfid.EncodeEpc, ZplRfid.DecodeEpc and ZplRfid.ParseEpcUri.

Properties

PropertyTypeDescription
AidcDataBits { get; }stringBits after the EPC when Epc.HasAidcData (not decoded; null otherwise).
Binary { get; }stringExact binary encoding ('0'/'1', header first) without padding.
BitLength { get; }intLength of Epc.Binary in bits.
CompanyPrefix { get; }stringThe EPC CompanyPrefix component (null when Epc.CompanyPrefixLength is unknown).
CompanyPrefixLength { get; }int?Number of digits of the EPC CompanyPrefix component (6–12): encoded in the partition of the fixed-length schemes, given by the caller for the "+" schemes (null when unknown).
Date { get; }stringDSGTIN+: the prioritised date YYMMDD.
DateAi { get; }stringDSGTIN+: AI of the prioritised date ("11", "13", "15", "16", "17", "7006" or "7007").
DigitalLinkUri { get; }stringGS1 Digital Link URI on id.gs1.org (Gs1DigitalLink.Build), e.g. "https://id.gs1.org/01/09506000134352/21/6789".
ElementString { get; }stringGS1 element string in bracketed form, e.g. "(01)09506000134352(21)6789".
Elements { get; }IReadOnlyList<Gs1Element>The GS1 element strings of the EPC identity.
Filter { get; }intFilter value 0–7 (control information, not part of the EPC identity; TDS §10).
FilterName { get; }stringMeaning of Epc.Filter for this key (TDS Tables 10-1 to 10-5), e.g. "Point of Sale (POS) Trade Item".
Giai { get; }stringGIAI, AI (8004).
Gln { get; }stringGLN (13 digits) of an SGLN.
GlnExtension { get; }stringGLN extension, AI (254); null for an SGLN without extension (encoded as extension "0", TDS §7.5).
Grai { get; }stringGRAI without serial: the 14 digits after AI (8003) (leading pad '0', company prefix, asset type, check digit).
Gtin { get; }stringGTIN-14 of an SGTIN / DSGTIN+.
HasAidcData { get; }bool"+" schemes: the +AIDC data toggle bit is set (additional AIDC data follows the EPC; TDS §14.5.1, §15.3).
Hex { get; }stringThe encoding as written to the EPC memory bank from bit 20h: hexadecimal, zero-padded to whole 16-bit words (TDS §15.1.1), e.g. 24 digits for a 96-bit EPC.
KeyType { get; }EpcKeyTypeThe GS1 key.
PureIdentityUri { get; }stringEPC Pure Identity URI (TDS §6.3), e.g. "urn:epc:id:sgtin:9506000134352.05.6789"; null when the company prefix length is unknown ("+" schemes decoded from binary).
Scheme { get; }EpcSchemeThe binary coding scheme.
SchemeInfo { get; }EpcSchemeInfoHeader, TDS name and length of Epc.Scheme.
Serial { get; }stringSerial number: AI (21) of an SGTIN, serial component of a GRAI (null for other keys).
Sscc { get; }stringSSCC (18 digits).
TagUri { get; }stringEPC Tag URI with the filter value (TDS §12), e.g. "urn:epc:tag:sgtin-96:3.95060001343.05.6789"; null for the "+" schemes, for which TDS 2.x defines no Tag URI.
Warnings { get; }IReadOnlyList<string>Warnings of the encoding or decoding (reserved filter value, ignored AIs, non-zero padding …).
WordCount { get; }intNumber of 16-bit words the EPC occupies in the EPC memory bank from bit 20h (PC length field).

Methods

Method SignatureReturnsDescription
# ConvertTo(EpcScheme scheme, int? filter = default)EpcThe same identity in another scheme (e.g. SGTIN-96 → SGTIN+), with an optional new filter value.
# Equals(object obj)boolSame scheme, filter and binary encoding.
# GetHashCode()int
# PcWord(bool userMemoryIndicator = false)ushortProtocol control word for this EPC (EPC bank bits 10h–1Fh, TDS Table 15-1): length = Epc.WordCount, UMI as given, XPC indicator 0, toggle 0 (GS1 EPC), attribute bits 0. 3000h for a 96-bit EPC.
# ToBytes()byte[]Epc.Hex as bytes.
# ToPureIdentityUri(int companyPrefixLength)stringPure Identity URI with an explicit company prefix length (6–12; 4 and 5 are treated as 6).
# ToString()stringTag URI when defined, else the element string with the scheme name.
EpcError Why an EPC could not be encoded or decoded (EpcException.Error). enum14 members#
public enum EpcError

Why an EPC could not be encoded or decoded (EpcException.Error).

Values

NameValueDescription
InvalidInput0The input is empty or not in the expected form.
InvalidElementString1The GS1 element string is invalid (format, check digit, characters; see the message).
MissingElement2A GS1 key the scheme needs is missing (e.g. (21) for an SGTIN).
InvalidCompanyPrefixLength3The GS1 Company Prefix length is missing or not 6 to 12 (4 and 5 are treated as 6, TDS §7.1).
InvalidFilter4The filter value is not 0 to 7.
GtinNotAllowed5TDS forbids this GTIN in an SGTIN (RCN-8, company internal or restricted circulation numbers, coupons, refund receipts, ISSN; TDS §7.3.3–7.3.8).
ValueOutOfRange6A serial, extension or asset reference does not fit the scheme (numeric only, no leading zero, value range, length).
InvalidCharacter7A character outside the set the scheme can encode (GS1 character set 82, TDS Table A-1).
InvalidDate8A date for DSGTIN+ is missing, ambiguous or invalid (TDS §14.5.3).
UnknownHeader9The binary encoding has a header that TDS does not assign, or a scheme this library does not decode.
Truncated10The binary encoding is shorter than the scheme needs.
InvalidBinary11A binary field holds a value TDS does not allow (partition 7, digits above 10^L, reserved bits not zero …).
InvalidHex12The hexadecimal string contains other characters than 0-9 A-F.
InvalidUri13The URI does not match the EPC URI grammar (TDS §6, §12).
EpcException An EPC could not be encoded or decoded; EpcException.Error says why, the message names the field and value. class2 members#
public sealed class EpcException : FormatException

An EPC could not be encoded or decoded; EpcException.Error says why, the message names the field and value.

Constructors

SignatureDescription
# EpcException(EpcError error, string message)An EPC could not be encoded or decoded; EpcException.Error says why, the message names the field and value.

Properties

PropertyTypeDescription
Error { get; }EpcError
EpcFilters Filter values of TDS §10 (Tables 10-1 to 10-5). class2 members#
public static class EpcFilters

Filter values of TDS §10 (Tables 10-1 to 10-5).

Methods

Method SignatureReturnsDescription
static # IsReserved(EpcKeyType key, int filter)boolTrue for filter values TDS marks "Reserved" (encoders SHOULD NOT write them, TDS §10.1).
static # Name(EpcKeyType key, int filter)stringMeaning of a filter value; "Reserved" for values TDS reserves.
EpcKeyType The GS1 key an EPC scheme identifies. enum5 members#
public enum EpcKeyType

The GS1 key an EPC scheme identifies.

Values

NameValueDescription
Sgtin0Serialised GTIN: AI (01) + (21).
Sscc1SSCC: AI (00).
Sgln2GLN with or without extension: AI (414) + (254).
Grai3Serialised GRAI: AI (8003).
Giai4GIAI: AI (8004).
EpcScheme EPC binary coding schemes of the GS1 EPC Tag Data Standard (TDS) 2.3 that ZplRfid encodes and decodes. The fixed-length schemes… enum15 members#
public enum EpcScheme

EPC binary coding schemes of the GS1 EPC Tag Data Standard (TDS) 2.3 that ZplRfid encodes and decodes. The fixed-length schemes (TDS 1.x, §14.6) have an EPC Tag URI; the "+" schemes (TDS 2.0, §14.5) are encoded from the GS1 element string and have no Tag URI.

Values

NameValueDescription
Sgtin960SGTIN-96 (header 30h): GTIN + numeric serial without leading zeros, below 2^38 (TDS §14.6.1.1).
Sgtin1981SGTIN-198 (header 36h): GTIN + serial of up to 20 characters of GS1 character set 82 (TDS §14.6.1.2).
SgtinPlus2SGTIN+ (header F7h): GTIN in 4-bit digits + variable-length serial, no company prefix length needed (TDS §14.6.1.3).
DsgtinPlus3DSGTIN+ (header FBh): SGTIN+ with a prioritised date (11), (13), (15), (16), (17), (7006) or (7007) (TDS §14.6.1.4).
Sscc964SSCC-96 (header 31h, TDS §14.6.2.1).
SsccPlus5SSCC+ (header F9h, 84 bits, TDS §14.6.2.2).
Sgln966SGLN-96 (header 32h): GLN + numeric extension below 2^41 (TDS §14.6.3.1).
Sgln1957SGLN-195 (header 39h): GLN + extension of up to 20 characters (TDS §14.6.3.2).
SglnPlus8SGLN+ (header F2h, TDS §14.6.3.3).
Grai969GRAI-96 (header 33h): GRAI with numeric serial below 2^38 (TDS §14.6.4.1).
Grai17010GRAI-170 (header 37h): GRAI with serial of up to 16 characters (TDS §14.6.4.2).
GraiPlus11GRAI+ (header F1h, TDS §14.6.4.3).
Giai9612GIAI-96 (header 34h): numeric individual asset reference (TDS §14.6.5.1).
Giai20213GIAI-202 (header 38h): alphanumeric individual asset reference (TDS §14.6.5.2).
GiaiPlus14GIAI+ (header FAh, TDS §14.6.5.3).
EpcSchemeInfo Static data of an EpcScheme: header, name, bit length. record13 members#
public record EpcSchemeInfo

Static data of an EpcScheme: header, name, bit length.

Constructors

SignatureDescription
# EpcSchemeInfo(EpcScheme Scheme, string Name, byte Header, int Bits, EpcKeyType Key)Static data of an EpcScheme: header, name, bit length. Scheme: The scheme. · Name: Name as in TDS Table 14-1 and in the Tag URI, e.g. "sgtin-96", "sgtin+". · Header: 8-bit EPC header (TDS Table 14-1). · Bits: Encoded length in bits, or 0 for variable-length "+" schemes. · Key: The GS1 key.

Properties

PropertyTypeDescription
static All { get; }IReadOnlyList<EpcSchemeInfo>All supported schemes.
Bits { get; init; }intEncoded length in bits, or 0 for variable-length "+" schemes.
Header { get; init; }byte8-bit EPC header (TDS Table 14-1).
IsPlus { get; }boolA TDS 2.0 "+" scheme (no Tag URI, no partition, +AIDC data toggle bit).
Key { get; init; }EpcKeyTypeThe GS1 key.
Name { get; init; }stringName as in TDS Table 14-1 and in the Tag URI, e.g. "sgtin-96", "sgtin+".
Scheme { get; init; }EpcSchemeThe scheme.

Methods

Method SignatureReturnsDescription
static # ByHeader(byte header)EpcSchemeInfoScheme by header byte, or null when TDS assigns no supported scheme to it.
static # ByName(string name)EpcSchemeInfoScheme by name ("sgtin-96", "SGTIN96", "sgtin+", "dsgtin-plus" …, case-insensitive), or null.
# Deconstruct(out EpcScheme Scheme, out string Name, out byte Header, out int Bits, out EpcKeyType Key)void
static # Of(EpcScheme scheme)EpcSchemeInfoInfo of scheme.
static # OtherSchemeName(byte header)stringTDS name of a header value that is defined in Table 14-1 but not supported here (e.g. "gid-96", "cpi-96", "sgtin++"), or null.
RfidBank Gen2 memory bank. enum4 members#
public enum RfidBank

Gen2 memory bank.

Values

NameValueDescription
Reserved0Bank 00: kill password (words 0–1) and access password (words 2–3).
Epc1Bank 01: CRC (word 0), PC (word 1), EPC from word 2 (bit 20h).
Tid2Bank 10: tag identification.
User3Bank 11: user memory.
RfidEncodeOptions Options of ZplRfid.BuildCommands (each null value omits its command). class21 members#
public sealed class RfidEncodeOptions

Options of ZplRfid.BuildCommands (each null value omits its command).

Constructors

SignatureDescription
# RfidEncodeOptions()

Properties

PropertyTypeDescription
AccessPassword { get; set; }stringAccess password, 8 hex digits, written with ^RFW,H,P (and used by the locks).
Antenna { get; set; }string^RW a: antenna element (A1 … E4), only multi-antenna printers.
ErrorHandling { get; set; }char?^RS e: error handling after the last try: 'N' no action (default), 'P' pause, 'E' error mode.
HostVerificationField { get; set; }int?^FN number for host verification: the EPC field gets ^FNn and ^HVn,…,L returns the written data per label (RFID Programming Guide 3, ^HV). Null: no ^HV.
HostVerificationHeader { get; set; }stringHeader text of the ^HV response (default "EPC:"); ^FH escapes are applied when it needs them.
KillPassword { get; set; }stringKill password, 8 hex digits, written with ^RFW,H,P.
LabelsToTry { get; set; }int?^RS n: labels tried when encoding fails (1–10, printer default 3).
LockAccessPassword { get; set; }RfidLockValue^RLM lock of the access password.
LockEpc { get; set; }RfidLockValue^RLM lock of the EPC bank (needs an access password other than 00000000 for Lock/Unlock).
LockKillPassword { get; set; }RfidLockValue^RLM lock of the kill password.
LockUser { get; set; }RfidLockValue^RLM lock of the user memory bank.
PcMode { get; set; }RfidPcModePC handling of the EPC write (default RfidPcMode.Auto).
ProgrammingPosition { get; set; }string^RS p: programming position, e.g. "F0", "F90" (mm forward), "B10" (mm backward) or dot rows "520".
ReadPower { get; set; }int?^RW r: read power 0–30.
Retries { get; set; }int?^RR n: read/write retries per block (0–10).
TagType { get; set; }int?^RS tag type (8 = EPC Class 1 Gen 2, the only type of current printers); null omits ^RS unless another ^RS value is set.
UseEpcFormat { get; set; }boolWrite the EPC as decimal fields with format E and an ^RB layout of the scheme (^RB96,8,3,3,…^FS ^RFW,E^FD48,…), like the ^RB example of the RFID Programming Guide: 96-bit schemes only, memory bank E (the PC length stays as on the tag, normally 96 bits). Default false (hex).
UserMemoryHex { get; set; }stringUser memory data (hex, even number of digits) written with ^RFW,H,0,n,3.
VoidLength { get; set; }int?^RS v: length of the VOID printout in dot rows.
WritePower { get; set; }int?^RW w: write power 0–30.
RfidHostResponse An ^HV host verification response. record5 members#
public record RfidHostResponse

An ^HV host verification response.

Constructors

SignatureDescription
# RfidHostResponse(int FieldNumber, string Text, bool PerLabel)An ^HV host verification response. FieldNumber: The ^FN number it reports. · Text: Header + data (first n characters) + terminator, as sent to the host. · PerLabel: a = L: one response per label (else F: once per format).

Properties

PropertyTypeDescription
FieldNumber { get; init; }intThe ^FN number it reports.
PerLabel { get; init; }boola = L: one response per label (else F: once per format).
Text { get; init; }stringHeader + data (first n characters) + terminator, as sent to the host.

Methods

Method SignatureReturnsDescription
# Deconstruct(out int FieldNumber, out string Text, out bool PerLabel)void
RfidLabelResult Outcome of encoding one label's tag (ZplRfidSimulator.Encode). class13 members#
public sealed class RfidLabelResult

Outcome of encoding one label's tag (ZplRfidSimulator.Encode).

Constructors

SignatureDescription
# RfidLabelResult()

Properties

PropertyTypeDescription
Epc { get; init; }EpcThe EPC on the tag after the operations, decoded (null when it is not a valid EPC).
Error { get; init; }stringThe first failure (null on success).
HostResponses { get; init; }IReadOnlyList<RfidHostResponse>^HV responses of this label.
LabelIndex { get; init; }int0-based label index (in ZplRfidSimulator.Simulate), else -1.
Notes { get; init; }IReadOnlyList<string>Simulation notes (commands that are accepted but not simulated, assumptions).
Operations { get; init; }IReadOnlyList<RfidOperationResult>
ReadValues { get; init; }IReadOnlyDictionary<int, string>Data of ^RF reads by ^FN number (what a printer prints in ^FN fields that show tag data).
ResultReport { get; init; }string~RV response for this label ("_+,n_" / "_-,n_") when result reporting is on, else null.
Success { get; init; }boolAll operations succeeded and every write read back correctly; false: the printer voids the label.
Tag { get; init; }RfidTagThe tag after the operations (null when there was none).
VoidedLabels { get; init; }intLabels the printer voided for this label (ZplRfidSimulator.Simulate; includes the last try when it failed).

Methods

Method SignatureReturnsDescription
# ToString()string
RfidLockState Lock state of a password or memory bank (Gen2 Lock command, ^RLM / ^RZ). enum4 members#
public enum RfidLockState

Lock state of a password or memory bank (Gen2 Lock command, ^RLM / ^RZ).

Values

NameValueDescription
Unlocked0Writable (passwords readable) in the open and secured state.
Locked1Writable (passwords readable) only in the secured state, i.e. with the right access password.
PermaUnlocked2Permanently unlocked: always writable, can never be locked.
PermaLocked3Permanently locked: never writable (passwords never readable).
RfidLockTarget What a lock applies to (^RLM k,a,e,u; ^RZ m). enum4 members#
public enum RfidLockTarget

What a lock applies to (^RLM k,a,e,u; ^RZ m).

Values

NameValueDescription
KillPassword0
AccessPassword1
Epc2
User3
RfidOperationResult One simulated RFID command and its outcome. record7 members#
public record RfidOperationResult

One simulated RFID command and its outcome.

Constructors

SignatureDescription
# RfidOperationResult(string Command, RfidTagStatus Status, string Message, int Offset)One simulated RFID command and its outcome. Command: ZPL as written, e.g. "^RFW,H,,,A". · Status: Tag status (Success when the command needs no tag or succeeded). · Message: What happened (bank, word, bytes, data read …). · Offset: Source offset of the command or field (-1 when unknown).

Properties

PropertyTypeDescription
Command { get; init; }stringZPL as written, e.g. "^RFW,H,,,A".
Message { get; init; }stringWhat happened (bank, word, bytes, data read …).
Offset { get; init; }intSource offset of the command or field (-1 when unknown).
Status { get; init; }RfidTagStatusTag status (Success when the command needs no tag or succeeded).
Success { get; }bool

Methods

Method SignatureReturnsDescription
# Deconstruct(out string Command, out RfidTagStatus Status, out string Message, out int Offset)void
RfidPc The protocol control (PC) word of the EPC memory bank, bits 10h–1Fh (TDS §9.3, Gen2). struct9 members#
public readonly record struct RfidPc

The protocol control (PC) word of the EPC memory bank, bits 10h–1Fh (TDS §9.3, Gen2).

Constructors

SignatureDescription
# RfidPc(ushort Value)The protocol control (PC) word of the EPC memory bank, bits 10h–1Fh (TDS §9.3, Gen2). Value: The 16-bit word.

Properties

PropertyTypeDescription
AttributeBits { get; }intAttribute bits (toggle 0) or AFI (toggle 1), bits 18h–1Fh.
EpcWords { get; }intLength field L4–L0 (bits 10h–14h): number of 16-bit EPC words from bit 20h.
Toggle { get; }boolNumbering system toggle (bit 17h): false = GS1 EPC, true = ISO UII with AFI.
UserMemoryIndicator { get; }boolUser memory indicator (bit 15h).
Value { get; init; }ushortThe 16-bit word.
XpcIndicator { get; }boolXPC_W1 indicator (bit 16h).

Methods

Method SignatureReturnsDescription
# Deconstruct(out ushort Value)void
static # For(int epcWords, bool userMemoryIndicator = false)RfidPcPC word for epcWords words of EPC, UMI, toggle 0 and attribute bits 0.
RfidPcMode How the ^RF command writes the EPC and the protocol control (PC) length bits. enum3 members#
public enum RfidPcMode

How the ^RF command writes the EPC and the protocol control (PC) length bits.

Values

NameValueDescription
Auto0^RFW,H,,,A: EPC at bit 20h and the printer sets the PC length bits to the data written (memory bank A, RFID Programming Guide 3, Link-OS printers). Works for every EPC length. Default.
Keep1^RFW,H (memory bank E, the ZPL default): writes 12 bytes at 20h and leaves the PC word as it is. Only for EPCs of 6 words (96-bit schemes, SSCC+) on tags whose PC already announces 96 bits (older firmware without bank A).
Explicit2^RFW,H,1,n,1: writes the PC word computed by TDS §15.1.1 together with the EPC, starting at word 1 of the EPC bank (works on all Gen2 printers, sets UMI from RfidEncodeOptions.UserMemoryHex).
RfidPrinterSettings Persistent RFID settings of the simulated printer (^RS, ^RR, ^RW; RFID Programming Guide 3). class10 members#
public sealed class RfidPrinterSettings

Persistent RFID settings of the simulated printer (^RS, ^RR, ^RW; RFID Programming Guide 3).

Constructors

SignatureDescription
# RfidPrinterSettings()

Properties

PropertyTypeDescription
Antenna { get; set; }string^RW a: antenna element (default A4).
ErrorHandling { get; set; }char^RS e: N, P or E (default N).
LabelsToTry { get; set; }int^RS n: labels tried when encoding fails (default 3).
ProgrammingPosition { get; set; }string^RS p: programming position ("F0" default).
ReadPower { get; set; }int^RW r: read power 0–30 (default 16).
Retries { get; set; }int^RR n: retries of a read or write on one tag (RFID Programming Guide 2 default 6).
TagType { get; set; }int^RS t: tag type (8 = Gen 2).
VoidLength { get; set; }int?^RS v: void printout length in dot rows (null = label length).
WritePower { get; set; }int^RW w: write power 0–30 (default 16).
RfidTag Simulated UHF Gen2 tag memory (TDS §9.2): reserved bank (kill and access password), EPC bank (StoredCRC, PC word, EPC), TID and… class24 members#
public sealed class RfidTag

Simulated UHF Gen2 tag memory (TDS §9.2): reserved bank (kill and access password), EPC bank (StoredCRC, PC word, EPC), TID and user memory, with Gen2 lock states and access password semantics. Used by ZplRfidSimulator; can also be prepared directly (pre-programmed or locked tags).

Constructors

SignatureDescription
# RfidTag(RfidTagProfile? profile = default, string? tid = default)A blank tag (all EPC and user bits zero, passwords 00000000, everything unlocked except the TID). profile: Memory sizes (default RfidTagProfile). · tid: TID bank contents in hex (default: a synthetic serialised TID starting with E2h, TDS §16).

Properties

PropertyTypeDescription
AccessPassword { get; }uintAccess password (reserved bank words 2–3).
EpcHex { get; }stringThe EPC as announced by the PC length bits, in hex.
FailingWrites { get; set; }intThe next n write operations fail (simulates a weak or damaged tag; the printer retries with ^RR).
KillPassword { get; }uintKill password (reserved bank words 0–1).
LockAccessPassword { get; }RfidLockState
LockEpc { get; }RfidLockState
LockKillPassword { get; }RfidLockState
LockTid { get; }RfidLockStateTID lock (permalocked by the tag manufacturer).
LockUser { get; }RfidLockState
Pc { get; }RfidPcStoredPC (EPC bank word 1).
Profile { get; }RfidTagProfileMemory sizes.
Silent { get; set; }boolThe tag does not answer (no tag at the antenna, dead tag).
StoredCrc { get; }ushortStoredCRC (EPC bank word 0): CRC-16 over PC and EPC words (Gen2, see RfidTag.Crc16).
TidHex { get; }stringTID bank in hex.
UserHex { get; }stringUser memory in hex.

Methods

Method SignatureReturnsDescription
# Bank(RfidBank bank)byte[]Whole bank contents (a copy).
static # Crc16(ReadOnlySpan<byte> data)ushortGen2 CRC-16 (ISO/IEC 13239: polynomial 1021h, preset FFFFh, ones' complement of the result; CRC-16/GENIBUS), as the tag computes the StoredCRC over the PC word and the EPC.
# DecodeEpc()EpcThe decoded EPC, or null when the EPC bank holds no valid EPC (see ZplRfid.TryDecodeEpc).
# Lock(RfidLockTarget target, RfidLockValue action, uint? accessPassword = default)RfidTagStatusGen2 Lock of a password or bank. Lock and unlock need the secured state; perma states cannot change.
# PermalockUserSections(int start, int count, uint? accessPassword = default)RfidTagStatusPermanently locks user memory sections (^RLB s,n; Gen2 BlockPermalock).
# Read(RfidBank bank, int word, int byteCount, uint? accessPassword = default)(RfidTagStatus, byte[])Reads byteCount bytes from word word of a bank. bank: Memory bank. · word: First 16-bit word. · byteCount: Bytes to read. · accessPassword: Access password the interrogator presents (null: none, i.e. open state).
# ToString()string
# Write(RfidBank bank, int word, ReadOnlySpan<byte> data, uint? accessPassword = default)RfidTagStatusWrites whole bytes from word word; an odd byte count fills the last word's low byte with 00h.
RfidTagProfile Memory sizes of a simulated tag. record8 members#
public record RfidTagProfile

Memory sizes of a simulated tag.

Constructors

SignatureDescription
# RfidTagProfile()

Properties

PropertyTypeDescription
ComputedUmi { get; init; }boolThe tag computes the UMI bit from user memory (Gen2v2 tags); false: UMI as written.
static Epc128User512 { get; }RfidTagProfileA tag with a 128-bit EPC area and 512 bits of user memory.
static Epc96 { get; }RfidTagProfileA tag with a 96-bit EPC area and no user memory.
EpcBits { get; init; }intBits of the EPC area from bit 20h (96 to 496; default 496 = largest a PC length can announce).
InitialPc { get; init; }ushortPC word of a blank tag (default 3000h: 96-bit EPC announced, as shipped by most inlay vendors).
UserBits { get; init; }intBits of user memory (0 = none; default 512).
UserSections { get; init; }intNumber of permalockable user memory sections (^RLB); default 8.
RfidTagStatus Result code of a simulated tag operation (after the Gen2 tag error codes). enum8 members#
public enum RfidTagStatus

Result code of a simulated tag operation (after the Gen2 tag error codes).

Values

NameValueDescription
Success0
NoTag1No tag in the field (the printer voids the label).
MemoryOverrun2The operation addresses words beyond the end of the bank (Gen2 "memory overrun").
MemoryLocked3The bank or password is locked and the access password does not open it (Gen2 "memory locked").
WrongPassword4The access password presented does not match the tag's.
WriteFailed5The write did not reach the tag (weak tag, RfidTag.FailingWrites).
VerifyFailed6Read-back after a write returned other data.
OtherError7Other error (e.g. writing the StoredCRC word).
ZplRfid RFID Studio: EPC encoding and decoding after the GS1 EPC Tag Data Standard (TDS 2.3), ZPL RFID command generation, consistency … class16 members#
public static class ZplRfid

RFID Studio: EPC encoding and decoding after the GS1 EPC Tag Data Standard (TDS 2.3), ZPL RFID command generation, consistency checks between the RFID commands and the printed barcodes, and a tag memory simulation.

Methods

Method SignatureReturnsDescription
static # BuildCommands(Epc epc, RfidEncodeOptions? options = default)stringZPL commands that encode epc into the tag of a label: ^RS (tag type, position, void, tries, error handling), ^RR, ^RW, ^RB (format E), the ^RF write of the EPC with PC handling, user memory, passwords, ^RLM locks and ^HV host verification. Insert the result between ^XA and ^XZ; it prints nothing.
static # Check(string zpl, ComplianceOptions? options = default)ComplianceReportRFID consistency pre-check of zpl with the built-in "rfid" rule pack (ZPL3901–ZPL3912): the EPC written by ^RF/^RQ is valid after TDS 2.3, fits the ^RF memory bank and PC bits, matches the GS1 keys printed on the label, and ^RB, ^RS, ^RL, ^HV are consistent. Same as ZplCompliance.Check(zpl, CompliancePacks.Rfid).
static # DecodeEpc(string hex)EpcDecodes the EPC binary encoding from EPC bank bit 20h, given as hex ("3074257BF7194E4000001A85"; spaces and a 0x prefix are allowed). Trailing word padding is ignored.
static # DecodeEpc(ReadOnlySpan<byte> data)EpcDecodes EPC bytes (from bit 20h of the EPC bank).
static # DecodeEpcBank(string hexFromPcWord)(RfidPc, Epc)Decodes EPC bank contents that start with the PC word (as read from word 1, e.g. with ^RFR,H,1,n,1): the PC length bits select how many words belong to the EPC.
static # DecodeEpcFields(string layout, string values)EpcDecodes the ^RB fields of format E back to an EPC (when the layout packs a supported scheme).
static # EncodeEpc(string elementString, int filter = 0, int? companyPrefixLength = default)EpcEncodes with the smallest fixed-length scheme that fits: SGTIN-96 / SGTIN-198, SSCC-96, SGLN-96 / SGLN-195, GRAI-96 / GRAI-170, GIAI-96 / GIAI-202 (the 96-bit scheme when the serial is numeric without leading zero and in range).
static # EncodeEpc(EpcScheme scheme, string elementString, int filter = 0, int? companyPrefixLength = default)EpcEncodes the GS1 key of elementString ("(01)…(21)…", "(00)…", "(414)…(254)…", "(8003)…", "(8004)…", bracketed or raw with FNC1/GS) in scheme. Values and check digits are validated. scheme: Binary scheme; see ZplRfid.EncodeEpc for automatic selection. · elementString: GS1 element string with the key (other AIs are ignored with a warning; DSGTIN+ also takes one date AI). · filter: Filter value 0–7 (TDS §10; 0 = "All Others"). · companyPrefixLength: Digits of the GS1 Company Prefix (6–12; 4 and 5 are encoded as 6). Required for the fixed-length schemes (it selects the partition), optional for the "+" schemes (then only Epc.PureIdentityUri stays null). A GTIN-8 always uses 8.
static # EncodeEpc(EpcScheme? scheme, IReadOnlyList<Gs1Element> elements, int filter = 0, int? companyPrefixLength = default)EpcEncodes AI/value pairs (e.g. from Gs1.Parse); scheme null picks the smallest fixed-length scheme like ZplRfid.EncodeEpc. Use this form for values with parentheses, which the bracketed element string cannot carry.
static # EncodeSgln(string gln, string extension, int? companyPrefixLength, int filter = 0, EpcScheme? scheme = default)EpcSGLN from a 13-digit GLN and an optional extension (AI 254).
static # EncodeSgtin(string gtin, string serial, int? companyPrefixLength, int filter = 0, EpcScheme? scheme = default)EpcSGTIN from a GTIN (8, 12, 13 or 14 digits with check digit) and serial (AI 21). gtin: GTIN-8, -12, -13 or -14 with check digit. · serial: Serial number, AI (21). · companyPrefixLength: GS1 Company Prefix digits (6–12, see ZplRfid.EncodeEpc). · filter: Filter value 0–7 (TDS Table 10-1; 1 = point of sale item). · scheme: Null: SGTIN-96 when the serial fits, else SGTIN-198.
static # EncodeSscc(string sscc, int? companyPrefixLength, int filter = 0, EpcScheme scheme = EpcScheme.Sscc96)EpcSSCC-96 (or scheme = EpcScheme.SsccPlus) from an 18-digit SSCC.
static # EpcLayout(Epc epc)(string, string)The ^RB layout and the ^FD field values (decimal, comma-separated) of a 96-bit EPC for ^RFW,E, e.g. ("96,8,3,3,24,20,38", "48,3,5,9506000,134355,6789"). Field widths follow the scheme's partition.
static # ParseEpcUri(string uri, EpcScheme? scheme = default, int filter = 0)EpcParses an EPC Tag URI ("urn:epc:tag:sgtin-96:3.0614141.812345.6789", control fields such as [att=x01] are ignored) or a Pure Identity URI ("urn:epc:id:sscc:0614141.1234567890") and encodes it. A Pure Identity URI carries neither scheme nor filter: pass scheme (default: smallest fixed-length scheme) and filter.
static # ToRfidItem(Epc epc)RfidItemA RfidItem (label designer) that writes epc in hex with tag type Gen 2 and PC auto-adjust (RfidMemoryBank.EpcAutoPc, ^RFW,H,,,A).
static # TryDecodeEpc(string hex, out Epc epc, out string error)boolZplRfid.DecodeEpc without exceptions.
ZplRfidCommand One RFID-related command of a rendered label, in format order, as the renderer saw it: ^RF, ^RQ, ^WT and ^WF fields with their … record11 members#
public record ZplRfidCommand

One RFID-related command of a rendered label, in format order, as the renderer saw it: ^RF, ^RQ, ^WT and ^WF fields with their resolved field data (after ^FN, ^FH, ^SN), the setup commands ^RB, ^RS, ^RR, ^RW, ^RZ, ^RL, ^HV, ^RU, ^RM and data of other ^FN fields (for ^HV). Used by the RFID consistency check and the tag simulation.

Constructors

SignatureDescription
# ZplRfidCommand(string Command, string Parameters, string Data, int? FieldNumber, int Offset, int Length)One RFID-related command of a rendered label, in format order, as the renderer saw it: ^RF, ^RQ, ^WT and ^WF fields with their resolved field data (after ^FN, ^FH, ^SN), the setup commands ^RB, ^RS, ^RR, ^RW, ^RZ, ^RL, ^HV, ^RU, ^RM and data of other ^FN fields (for ^HV). Used by the RFID consistency check and the tag simulation. Command: Command name without prefix: "RF", "RB", "RS", "HV" …; "FN" for a non-RFID field with a field number. · Parameters: Raw parameters of the command. · Data: Resolved field data (^RF write data, ^FN field text); null for setup commands and reads. · FieldNumber: ^FN number of the field, if any. · Offset: Source offset of the field (its first command) or of the command; -1 when unknown. · Length: Length of the field's source block (up to ^FS) or of the command.

Properties

PropertyTypeDescription
Command { get; init; }stringCommand name without prefix: "RF", "RB", "RS", "HV" …; "FN" for a non-RFID field with a field number.
Data { get; init; }stringResolved field data (^RF write data, ^FN field text); null for setup commands and reads.
EpcLayout { get; init; }string^RB layout in effect for this command (persistent printer setting, TDS-independent); null when none was set.
FieldNumber { get; init; }int?^FN number of the field, if any.
HexIndicator { get; init; }char?^FH indicator of the field (for ^HV header/terminator), if any.
Length { get; init; }intLength of the field's source block (up to ^FS) or of the command.
Offset { get; init; }intSource offset of the field (its first command) or of the command; -1 when unknown.
Parameters { get; init; }stringRaw parameters of the command.

Methods

Method SignatureReturnsDescription
# Arg(int i)stringArgument i (comma-separated, trimmed) or "".
# Deconstruct(out string Command, out string Parameters, out string Data, out int? FieldNumber, out int Offset, out int Length)void
ZplRfidSimulator RFID tag simulation: executes the RFID commands of a label (^RF write/read/passwords, ^RQ, ^RZ, ^RLM/^RLB, ^RS, ^RR, ^RW, ^HV) … class10 members#
public sealed class ZplRfidSimulator

RFID tag simulation: executes the RFID commands of a label (^RF write/read/passwords, ^RQ, ^RZ, ^RLM/^RLB, ^RS, ^RR, ^RW, ^HV) against a simulated Gen2 RfidTag like a Zebra RFID printer: EPC written at 20h with memory bank E (12 bytes) or A (PC length adjusted), read-back verification, access password and lock semantics, retries (^RR), void and re-try of the label (^RS n), ^HV responses and ~RV result reporting. ZplVirtualPrinter.RfidSimulator uses it per printed label.

Assumptions where the RFID programming guides are silent: ^RF with memory bank E and less than 12 bytes of data zero-fills the rest of the 96 bits; more than 12 bytes is an encode error; a byte count n that differs from the data length writes n bytes (data truncated or zero-filled). ^WT, ^WF, ^RU, ^RM, ^RT and ^RI are accepted and noted but not simulated. Not thread-safe; one instance per printer.

Constructors

SignatureDescription
# ZplRfidSimulator()

Properties

PropertyTypeDescription
ReportResults { get; set; }bool~RV E / D: report "_+,n_" / "_-,n_" after each label (default false).
Settings { get; }RfidPrinterSettingsPersistent ^RS / ^RR / ^RW state (updated by the commands of every label).
TagProfile { get; set; }RfidTagProfileMemory sizes of the tags ZplRfidSimulator.NextTag supplies (default RfidTagProfile: 496-bit EPC, 512-bit user memory).
TagSupply { get; set; }Func<int, RfidTag>Supplies the tag of the n-th label (0-based, counting voided labels); return null for "no tag in the field". Default: a new blank tag of ZplRfidSimulator.TagProfile. Use it for pre-programmed, locked or weak tags.

Methods

Method SignatureReturnsDescription
# ApplySettings(IReadOnlyList<ZplRfidCommand> commands)voidApplies the persistent ^RS / ^RR / ^RW settings of a label without touching a tag (to know ^RS n before encoding).
# Encode(IReadOnlyList<ZplRfidCommand> commands, RfidTag tag)RfidLabelResultExecutes one label's RFID commands on tag (one encoding attempt).
# NextTag()RfidTagThe next tag from ZplRfidSimulator.TagSupply (or a blank one).
static # Report(bool success, int voided)string~RV response (RFID Programming Guide 2): "_+,n_" success after n voided labels, "_-,n_" failed after n voided labels.
# Simulate(string zpl, ZplRenderSettings? settings = default)IReadOnlyList<RfidLabelResult>Renders zpl (to resolve ^FN, ^FH, ^SN …) and encodes every label with RFID commands like a printer: on failure the label is voided and retried with the next tag up to ^RS n times. ~RVE / ~RVD in the input switch result reporting.

ZplCore.ScanProof #

15 types

Digital barcode verification: dual-decoder read-back (ZXing.Net + zxing-cpp), ISO/IEC 15416 & 15415 pre-check grading, quiet-zone measurement, and robustness simulation.

ScanProofCoverage Decoder coverage of one symbology (see ZplScanProof.Coverage). record10 members#
public record ScanProofCoverage

Decoder coverage of one symbology (see ZplScanProof.Coverage).

Constructors

SignatureDescription
# ScanProofCoverage(string Symbology, string ZplCommand, string GeneratorSymbology, bool ZxingCpp, bool ZxingNet, ScanProofSymbolKind Kind, string QuietZone)Decoder coverage of one symbology (see ZplScanProof.Coverage). Symbology: Symbology name. · ZplCommand: ZPL command ("^BC"), or "" for symbologies of the stand-alone generator only. · GeneratorSymbology: Matching Symbology value(s) of the stand-alone generator, comma separated ("" if none). · ZxingCpp: zxing-cpp decodes it. · ZxingNet: ZXing.Net decodes it. · Kind: Measurement and grading model. · QuietZone: Required quiet zone in modules ("10X", "11X/7X", "—" when no requirement is checked).

Properties

PropertyTypeDescription
Decodable { get; }boolAt least one decoder reads it; otherwise only structural checks are made.
GeneratorSymbology { get; init; }stringMatching Symbology value(s) of the stand-alone generator, comma separated ("" if none).
Kind { get; init; }ScanProofSymbolKindMeasurement and grading model.
QuietZone { get; init; }stringRequired quiet zone in modules ("10X", "11X/7X", "—" when no requirement is checked).
Symbology { get; init; }stringSymbology name.
ZplCommand { get; init; }stringZPL command ("^BC"), or "" for symbologies of the stand-alone generator only.
ZxingCpp { get; init; }boolzxing-cpp decodes it.
ZxingNet { get; init; }boolZXing.Net decodes it.

Methods

Method SignatureReturnsDescription
# Deconstruct(out string Symbology, out string ZplCommand, out string GeneratorSymbology, out bool ZxingCpp, out bool ZxingNet, out ScanProofSymbolKind Kind, out string QuietZone)void
ScanProofDataStatus How a symbol's decoded data compares with the data the field asks for. enum7 members#
public enum ScanProofDataStatus

How a symbol's decoded data compares with the data the field asks for.

Values

NameValueDescription
Match0Decoded data equals the expected data (and the field data as written).
DataAltered1Decoded data equals the expected data, but that differs from the field data as written because the symbology rules changed it (check digit replaced, characters dropped or upper-cased, data padded or truncated).
Mismatch2A decoder read the symbol, but the data differs from the expected data.
NotDecoded3The symbology is supported by an available decoder, but no decoder could read the rendered symbol.
NotDecodable4No available decoder supports this symbology: only the structural checks were made.
NotRendered5The field was not drawn at all (invalid data etc.; see the render diagnostics).
Unverified6A decoder read the symbol, but the expected data could not be derived from the field data, so nothing was compared.
ScanProofDecoderInfo Information about one decoder backend. record7 members#
public record ScanProofDecoderInfo

Information about one decoder backend.

Constructors

SignatureDescription
# ScanProofDecoderInfo(string Name, string Version, string License, bool Available, string Reason)Information about one decoder backend. Name: "zxing-cpp" or "ZXing.Net". · Version: Package version. · License: SPDX licence identifier. · Available: The decoder could be loaded on this platform. · Reason: Why it is unavailable (null when available).

Properties

PropertyTypeDescription
Available { get; init; }boolThe decoder could be loaded on this platform.
License { get; init; }stringSPDX licence identifier.
Name { get; init; }string"zxing-cpp" or "ZXing.Net".
Reason { get; init; }stringWhy it is unavailable (null when available).
Version { get; init; }stringPackage version.

Methods

Method SignatureReturnsDescription
# Deconstruct(out string Name, out string Version, out string License, out bool Available, out string Reason)void
ScanProofDecoderResult Result of one decoder for one symbol (or one component of a composite symbol). record10 members#
public record ScanProofDecoderResult

Result of one decoder for one symbol (or one component of a composite symbol).

Constructors

SignatureDescription
# ScanProofDecoderResult()

Properties

PropertyTypeDescription
Component { get; init; }stringSymbol component ("" for a single symbol; "Code 39" / "MicroPDF417" for TLC39).
Data { get; init; }stringDecoded data (FNC1 separators as GS U+001D; GS1 data in raw form), null when not decoded.
Decoded { get; init; }boolThe decoder read the symbol on the rendered label.
required Decoder { get; init; }stringDecoder name ("zxing-cpp", "ZXing.Net").
ErrorsCorrected { get; init; }int?Codewords the decoder had to correct (2D/stacked, when the decoder reports it).
Gs1 { get; init; }boolThe decoded data is GS1 data (FNC1 in first position / GS1 symbology identifier).
MatchesExpected { get; init; }bool?The decoded data equals the expected data.
Supported { get; init; }boolThe decoder supports this symbology.
SymbologyIdentifier { get; init; }stringSymbology identifier reported by the decoder (e.g. "]C1"), if any.
ScanProofFinding One message about a symbol. ScanProofFinding.Code is stable (see docs-internal/scan-proof.md). record5 members#
public record ScanProofFinding

One message about a symbol. ScanProofFinding.Code is stable (see docs-internal/scan-proof.md).

Constructors

SignatureDescription
# ScanProofFinding(string Code, ScanProofSeverity Severity, string Message)One message about a symbol. ScanProofFinding.Code is stable (see docs-internal/scan-proof.md). Code: Stable identifier, e.g. "SP1001". · Severity: How serious the finding is. · Message: Human-readable text (may change between versions).

Properties

PropertyTypeDescription
Code { get; init; }stringStable identifier, e.g. "SP1001".
Message { get; init; }stringHuman-readable text (may change between versions).
Severity { get; init; }ScanProofSeverityHow serious the finding is.

Methods

Method SignatureReturnsDescription
# Deconstruct(out string Code, out ScanProofSeverity Severity, out string Message)void
ScanProofGrade Letter grade of the digital pre-check, modelled on the ISO/IEC 15416 (linear) and ISO/IEC 15415 (2D) grade scale (A = 4 … F = 0… enum5 members#
public enum ScanProofGrade

Letter grade of the digital pre-check, modelled on the ISO/IEC 15416 (linear) and ISO/IEC 15415 (2D) grade scale (A = 4 … F = 0). It is computed from the rendered bitmap, not measured with a verifier: it is a prediction of how the digital symbol scores, not an ISO-conformant print quality grade.

Values

NameValueDescription
F0
D1
C2
B3
A4
ScanProofParameter One graded parameter. record8 members#
public record ScanProofParameter

One graded parameter.

Constructors

SignatureDescription
# ScanProofParameter(string Name, double? Value, string Unit, ScanProofGrade? Grade, string Model, string Note = "")One graded parameter. Name: Parameter name ("Symbol contrast", "Quiet zone" …). · Value: Measured value in Unit (null: not measured). · Unit: "%", "X", "dots", "ratio" … ("" for counts and grades). · Grade: Grade of this parameter (null: reported only, not graded). · Model: "ISO/IEC 15416", "ISO/IEC 15415" (parameter modelled on that standard) or "zplCore" (own geometric check). · Note: Short explanation.

Properties

PropertyTypeDescription
Grade { get; init; }ScanProofGrade?Grade of this parameter (null: reported only, not graded).
Model { get; init; }string"ISO/IEC 15416", "ISO/IEC 15415" (parameter modelled on that standard) or "zplCore" (own geometric check).
Name { get; init; }stringParameter name ("Symbol contrast", "Quiet zone" …).
Note { get; init; }stringShort explanation.
Unit { get; init; }string"%", "X", "dots", "ratio" … ("" for counts and grades).
Value { get; init; }double?Measured value in Unit (null: not measured).

Methods

Method SignatureReturnsDescription
# Deconstruct(out string Name, out double? Value, out string Unit, out ScanProofGrade? Grade, out string Model, out string Note)void
ScanProofQuietZoneLimit What ends a quiet zone measured on the bitmap. enum3 members#
public enum ScanProofQuietZoneLimit

What ends a quiet zone measured on the bitmap.

Values

NameValueDescription
None0Clear up to the measuring range (at least the required quiet zone plus a margin).
Ink1Ink of another field (or of this field's own interpretation line, for 2D symbols).
LabelEdge2The edge of the label (^PW/^LL).
ScanProofQuietZones Quiet zones measured on the rendered label, in printer dots and in modules (X). record18 members#
public record ScanProofQuietZones

Quiet zones measured on the rendered label, in printer dots and in modules (X).

Constructors

SignatureDescription
# ScanProofQuietZones()

Properties

PropertyTypeDescription
Bottom { get; init; }double
BottomDots { get; init; }int
BottomLimit { get; init; }ScanProofQuietZoneLimit
Left { get; init; }doubleClear space in modules (dots / X).
LeftDots { get; init; }intClear space found (dots); for linear symbols the minimum over the scan lines.
LeftLimit { get; init; }ScanProofQuietZoneLimit
RequiredBottom { get; init; }double
RequiredLeft { get; init; }doubleRequired quiet zone of the symbology in modules (per side; for EAN/UPC left and right differ).
RequiredRight { get; init; }double
RequiredTop { get; init; }double
Right { get; init; }double
RightDots { get; init; }int
RightLimit { get; init; }ScanProofQuietZoneLimit
Top { get; init; }double
TopDots { get; init; }int
TopLimit { get; init; }ScanProofQuietZoneLimit
Vertical { get; init; }boolTop/bottom quiet zones apply (2D and stacked symbols).
ScanProofRect Axis-aligned rectangle on the label in dots. record6 members#
public record ScanProofRect

Axis-aligned rectangle on the label in dots.

Constructors

SignatureDescription
# ScanProofRect(int X, int Y, int Width, int Height)Axis-aligned rectangle on the label in dots.

Properties

PropertyTypeDescription
Height { get; init; }int
Width { get; init; }int
X { get; init; }int
Y { get; init; }int

Methods

Method SignatureReturnsDescription
# Deconstruct(out int X, out int Y, out int Width, out int Height)void
ScanProofReport Result of ZplScanProof.Verify: one entry per barcode symbol. class14 members#
public sealed class ScanProofReport

Result of ZplScanProof.Verify: one entry per barcode symbol.

Constructors

SignatureDescription
# ScanProofReport()

Properties

PropertyTypeDescription
Decoders { get; init; }IReadOnlyList<ScanProofDecoderInfo>
Disclaimer { get; }stringAlways ZplScanProof.Disclaimer: a digital pre-check, not an ISO-conformant verification.
Dpi { get; init; }int
Findings { get; }IEnumerable<(ScanProofSymbol, ScanProofFinding)>All findings of all symbols.
HasDataProblems { get; }boolAny symbol whose data is wrong or unreadable (ScanProofSymbol.IsDataProblem).
LabelCount { get; init; }intLabels rendered (including identical ^PQ copies).
LowestGrade { get; }ScanProofGrade?Lowest grade of all graded symbols (null when none was graded).
RenderDiagnostics { get; init; }IReadOnlyList<ZplDiagnostic>Render diagnostics of the checked labels (see DIAGNOSTICS.md).
SkippedCopies { get; init; }intIdentical ^PQ copies that were not checked again.
Symbols { get; init; }IReadOnlyList<ScanProofSymbol>

Methods

Method SignatureReturnsDescription
# ToJson(bool indented = true)stringThe report as JSON (camelCase, enums as strings, nulls omitted).
# ToSarif(string? artifactUri = default)stringThe findings as SARIF 2.1.0 (one run, tool "zplCore scan-proof"; rule ids SP…, plus one SP1500 note per graded symbol with its digital grade). artifactUri is the checked file (relative URI, default "label.zpl"), as in the compliance report.
# ToText()stringHuman-readable summary (one block per symbol).
ScanProofRobustnessCheck Outcome of one robustness simulation (heuristic, not a print physics model). record5 members#
public record ScanProofRobustnessCheck

Outcome of one robustness simulation (heuristic, not a print physics model).

Constructors

SignatureDescription
# ScanProofRobustnessCheck(string Name, bool Passed, string Detail)Outcome of one robustness simulation (heuristic, not a print physics model). Name: Degradation, e.g. "bar gain +1 dot". · Passed: At least one decoder still read the expected data. · Detail: What was simulated.

Properties

PropertyTypeDescription
Detail { get; init; }stringWhat was simulated.
Name { get; init; }stringDegradation, e.g. "bar gain +1 dot".
Passed { get; init; }boolAt least one decoder still read the expected data.

Methods

Method SignatureReturnsDescription
# Deconstruct(out string Name, out bool Passed, out string Detail)void
ScanProofSeverity Severity of a ScanProofFinding. enum3 members#
public enum ScanProofSeverity

Severity of a ScanProofFinding.

Values

NameValueDescription
Info0
Warning1
Error2
ScanProofSymbol Scan-proof result for one barcode symbol on one label. record45 members#
public record ScanProofSymbol

Scan-proof result for one barcode symbol on one label.

Constructors

SignatureDescription
# ScanProofSymbol()

Properties

PropertyTypeDescription
BarHeightDots { get; init; }double?Bar height (linear) or symbol height (2D) in dots and millimetres.
BarHeightMm { get; init; }double?
ClippedPixels { get; init; }intPixels of this symbol that lie outside the label (cut off by ^PW/^LL).
Column { get; init; }int
Columns { get; init; }int?
required Command { get; init; }stringZPL command, e.g. "^BC".
DecodedData { get; init; }stringData read back from the rendered bitmap (first decoder that read it), null when not decoded.
Decoders { get; init; }IReadOnlyList<ScanProofDecoderResult>
ExpectedData { get; init; }stringData the symbol must carry, derived from the field data with the symbology rules of the ZPL command (check digits added, invocation codes resolved, start/stop characters …); GS1 data in raw form with GS separators. Null when it cannot be derived.
ExpectedGs1 { get; init; }boolThe expected data is GS1 data (FNC1 in first position).
FieldData { get; init; }stringField data after ^FH, ^FN/field values, ^SN/^SF and clock substitution (what the renderer received).
Findings { get; init; }IReadOnlyList<ScanProofFinding>
Grade { get; init; }ScanProofGrade?Overall digital grade (lowest of the graded parameters); null when the symbol could not be graded.
GradeValue { get; init; }double?Numeric grade 0.0–4.0 (average of the scan-line grades for linear symbols, capped by the geometric parameters).
GreyPixels { get; init; }intGrey (anti-aliased) pixels inside the symbol area.
Height { get; init; }int
HumanReadable { get; init; }stringInterpretation line printed by the barcode command (null: none).
HumanReadableMatches { get; init; }bool?The interpretation line agrees with the decoded data (null: no line or nothing to compare).
Index { get; init; }int0-based index of the symbol on its label.
IntegerModules { get; init; }bool?Every bar and space is a whole multiple of X (two-width codes: narrow and wide are whole dots).
IsDataProblem { get; }boolData is wrong or unreadable: ScanProofDataStatus.Mismatch, ScanProofDataStatus.DataAltered, ScanProofDataStatus.NotDecoded or ScanProofDataStatus.NotRendered.
Kind { get; init; }ScanProofSymbolKind
LabelIndex { get; init; }int0-based label index (^PQ copies and formats in order).
Line { get; init; }int
MaxBarGainDots { get; init; }int?Largest simulated bar gain/loss (whole dots per edge pair) at which the symbol still decodes (heuristic; null when not run).
MaxBarLossDots { get; init; }int?
OverlapPixels { get; init; }intPixels inside the symbol or its quiet zone where the label differs from the symbol's own ink (other fields drawn over or into it).
Parameters { get; init; }IReadOnlyList<ScanProofParameter>
QuietZones { get; init; }ScanProofQuietZones
Robustness { get; init; }IReadOnlyList<ScanProofRobustnessCheck>
Rotation { get; init; }intRotation of the field: 0, 90, 180 or 270 degrees clockwise (^B…N/R/I/B).
Rows { get; init; }int?Rows × columns of modules for 2D symbols.
SourceLength { get; init; }int
SourceOffset { get; init; }intField block in the ZPL source (offset/length, 1-based line/column; -1/0 when unknown).
Status { get; init; }ScanProofDataStatus
SymbolBounds { get; init; }ScanProofRectThe symbol itself on the label (bars or modules without interpretation line and quiet zones), in dots; for stand-alone barcodes in bitmap pixels. Null when nothing was drawn.
SymbolWidthDots { get; init; }double?Symbol width (bars or modules, without quiet zones) in dots.
required Symbology { get; init; }stringSymbology name, e.g. "Code 128", "GS1-128", "QR Code".
WideToNarrowRatio { get; init; }double?Realised wide:narrow ratio of two-width symbologies.
Width { get; init; }int
X { get; init; }intLogical field box on the label in dots (as ZplRenderedElement).
XDimensionDots { get; init; }double?Narrow module width (X) measured on the bitmap, in dots and millimetres (null: not measurable).
XDimensionMm { get; init; }double?
Y { get; init; }int
ScanProofSymbolKind Kind of symbol, which decides the measurements and the grading model. enum6 members#
public enum ScanProofSymbolKind

Kind of symbol, which decides the measurements and the grading model.

Values

NameValueDescription
Linear0Single-row bar code (ISO/IEC 15416 model).
Stacked1Multi-row symbol (PDF417, MicroPDF417, Codablock F, Code 49, DataBar stacked).
Matrix2Matrix symbol (QR, Data Matrix, Aztec; ISO/IEC 15415 model).
MaxiCode3MaxiCode (hexagonal modules).
Postal4Height-modulated or 4-state postal code.
Composite5Two linked symbols (TLC39: Code 39 with MicroPDF417).

ZplCore.Testing #

31 types

Fluent semantic label assertions (ZplAssert, LabelAssertions, BarcodeAssertions, TextAssertions), element selectors, and printer fit assertions.

BarcodeAssertions Assertions on one barcode: scan-proof (decode, grade, quiet zones) and measured geometry. class10 members#
public sealed class BarcodeAssertions : ElementAssertions<BarcodeAssertions, ComplianceBarcode>

Assertions on one barcode: scan-proof (decode, grade, quiet zones) and measured geometry.

Properties

PropertyTypeDescription
Symbol { get; }ScanProofSymbolThe scan-proof result of this barcode (decoders, grade, quiet zones, findings); null when not found.

Methods

Method SignatureReturnsDescription
# Decodes()BarcodeAssertionsDecoders read the barcode back from the render, with the data its field asks for.
# Decodes(string expected)BarcodeAssertionsDecoders read exactly expected. GS1 data may be written as "(00)376…" (parentheses), raw with GS separators, or with "^FNC1"; it compares element by element.
# HasBarHeight(double atLeastMm)BarcodeAssertionsLinear barcodes: the bar height is at least atLeastMm mm.
# HasGrade(char atLeast)BarcodeAssertionsThe digital pre-check grade (modelled on ISO/IEC 15416/15415) is at least atLeast ('A'–'D').
# HasGrade(ScanProofGrade atLeast)BarcodeAssertionsThe digital pre-check grade is at least atLeast.
# HasQuietZones()BarcodeAssertionsThe quiet zones (clear space before and after the symbol) are at least what the symbology requires.
# HasXDimension(double minMm, double maxMm = 1.7976931348623157E+308)BarcodeAssertionsThe measured X-dimension (narrowest bar or module) is between minMm and maxMm.
# IsGs1(string? ai = default, string? value = default)BarcodeAssertionsThe barcode carries GS1 element strings (FNC1 first) – optionally with AI ai = value.
# IsSymbology(ComplianceSymbology symbology)BarcodeAssertionsThe barcode has the symbology symbology.
ElementAssertions<TSelf, TElement> Assertions shared by text and barcode elements: position and layout. When the element could not be selected (inside a ZplAssert… class9 members#
public abstract class ElementAssertions<TSelf, TElement>

Assertions shared by text and barcode elements: position and layout. When the element could not be selected (inside a ZplAssertionScope) every further assertion is skipped.

Properties

PropertyTypeDescription
And { get; }LabelAssertionsBack to the label for more assertions.
Element { get; }TElementThe selected element (null when the selection failed inside a scope).

Methods

Method SignatureReturnsDescription
# DoesNotOverlap(string other)TSelfThe element's ink does not overlap any element matched by other (text content or barcode selector).
# DoesNotOverlapAnything()TSelfThe element's ink does not overlap any other element.
# IsAbove(string other)TSelfThe element ends above the top of every element matched by other.
# IsAt(double xMm, double yMm, double toleranceMm = 0.5)TSelfThe element's top-left corner is at (xMm, yMm) ± toleranceMm.
# IsBelow(string other)TSelfThe element starts below the bottom of every element matched by other.
# IsInside(double xMm, double yMm, double widthMm, double heightMm)TSelfThe element lies completely inside the area (mm from the top-left label corner).
# IsWithinLabel(double marginMm = 0)TSelfThe element lies completely on the label, at least marginMm from every edge.
ElementChange A semantic difference between two renders of a label. record8 members#
public record ElementChange

A semantic difference between two renders of a label.

Constructors

SignatureDescription
# ElementChange(ElementChangeKind Kind, int LabelIndex, SnapshotElement Before, SnapshotElement After, string Description)A semantic difference between two renders of a label.

Properties

PropertyTypeDescription
After { get; init; }SnapshotElement
Before { get; init; }SnapshotElement
Description { get; init; }string
IsContentChange { get; }boolAdded, removed and content changes – changes a pixel tolerance must not hide.
Kind { get; init; }ElementChangeKind
LabelIndex { get; init; }int

Methods

Method SignatureReturnsDescription
# Deconstruct(out ElementChangeKind Kind, out int LabelIndex, out SnapshotElement Before, out SnapshotElement After, out string Description)void
ElementChangeKind Kind of a ElementChange. enum4 members#
public enum ElementChangeKind

Kind of a ElementChange.

Values

NameValueDescription
Added0A new element.
Removed1An element is gone.
ContentChanged2Same element, text or data changed.
Moved3Same element and content, different position or size.
IZplPrinterFit Extension point of LabelAssertions.FitsPrinter and zplcore check --printer: anything that can tell whether a label prints corre… interface2 members#
public interface IZplPrinterFit

Extension point of LabelAssertions.FitsPrinter and zplcore check --printer: anything that can tell whether a label prints correctly on a printer. PrinterSpec is the built-in, data-sheet based implementation; PrinterProfileFit adapts the Printer Twin (model profiles with firmware, fonts, memory and options), and in-house printer fleets can implement it too.

Properties

PropertyTypeDescription
Name { get; }stringPrinter name for messages ("ZD421 203 dpi").

Methods

Method SignatureReturnsDescription
# Check(PrinterFitContext context)IEnumerable<PrinterFitIssue>Every reason the labels do not fit (empty when they do).
LabelAssertions Fluent assertions on a rendered ZPL job. Job-level assertions (LabelAssertions.HasLabels, LabelAssertions.Renders, LabelAsserti… class25 members#
public sealed class LabelAssertions

Fluent assertions on a rendered ZPL job. Job-level assertions (LabelAssertions.HasLabels, LabelAssertions.Renders, LabelAssertions.Complies, LabelAssertions.MatchesSnapshot, LabelAssertions.NoOverlaps, LabelAssertions.NoClipping, LabelAssertions.AllBarcodesDecode, LabelAssertions.FitsPrinter) check every label; after LabelAssertions.OnLabel they check that label only. Element selectors (LabelAssertions.Barcode, LabelAssertions.Text, LabelAssertions.FieldEquals) search label 0 unless LabelAssertions.OnLabel picks another one.

Properties

PropertyTypeDescription
Current { get; }ComplianceLabelThe label element selectors work on (label 0 unless LabelAssertions.OnLabel was used); null when the job has no such label.
Labels { get; }IReadOnlyList<ComplianceLabel>The measured labels of the job (elements with bounds in dots, ink) for custom assertions.
ScanProof { get; }ScanProofReportThe scan-proof report of the job (every barcode decoded back, measured and graded).

Methods

Method SignatureReturnsDescription
# AllBarcodesDecode()LabelAssertionsEvery barcode decodes back to the data its field asks for (scan-proof, two independent decoders).
# AllBarcodesHaveGrade(char atLeast)LabelAssertionsEvery graded barcode reaches at least grade atLeast (A–D) in the digital pre-check.
# Barcode(string selector, int? index = default)BarcodeAssertionsSelects one barcode of the label (see ZplSelectors: "#0", "^BC", "QR", "GS1-128", "SSCC", "(01)", or a substring of the data). Fails when nothing or – without index – more than one barcode matches. selector: Which barcode. · index: Pick the n-th match (0-based) when several barcodes match.
# Barcode(Func<ComplianceBarcode, bool> predicate, string description = "")BarcodeAssertionsSelects the barcode that satisfies predicate (exactly one).
# Complies(CompliancePacks packs, ComplianceSeverity failOn = ComplianceSeverity.Error)LabelAssertionsRuns compliance rule packs and fails on findings of failOn or above (default errors).
# Complies(ComplianceRulePack pack, ComplianceSeverity failOn = ComplianceSeverity.Error)LabelAssertionsRuns compliance rule packs (built-in or custom) and fails on findings of failOn or above.
# DoesNotHaveText(string text)LabelAssertionsNo text field of the label contains text (e.g. "TODO", "{{", placeholder data).
# FieldEquals(int fieldNumber, string expected)LabelAssertionsThe field with ^FNfieldNumber prints expected.
# FieldEquals(string field, string expected)LabelAssertionsThe field "FN1" / "^FN1" / "1" prints expected (data as drawn, after ^FH, ^SN and field values).
# FitsPrinter(PrinterProfile profile, bool failOnWarnings = false)LabelAssertionsThe labels print correctly on the printer model of profile (Printer Twin: printhead width and clipped fields, maximum length, resolution, firmware, options, fonts, memory; see PrinterProfileFit). profile: A printer profile, e.g. PrinterProfiles.Get("ZD421-203"). · failOnWarnings: Also fail on issues of severity warning.
# FitsPrinter(IZplPrinterFit printer, bool failOnWarnings = false)LabelAssertionsThe labels fit printer: resolution, print width, label length – or whatever the implementation checks (see IZplPrinterFit, e.g. a Printer Twin profile). printer: Printer limits. · failOnWarnings: Also fail on issues of severity warning.
# HasBarcodes(int count)LabelAssertionsThe label has exactly count barcodes.
# HasLabels(int count)LabelAssertionsThe job prints exactly count label formats (^XA…^XZ; ^PQ copies count once).
# HasText(string text)LabelAssertionsSome text field of the label contains text.
# MatchesSnapshot(string name, double tolerancePercent)LabelAssertionsPixel snapshot with tolerancePercent % changed pixels allowed (see LabelAssertions.MatchesSnapshot).
# MatchesSnapshot(string name, SnapshotTolerance? tolerance = default)LabelAssertionsCompares the 1-bit render of every label with the approved snapshot name.approved.png (plus the semantic snapshot name.approved.json) in ZplAssertSettings.SnapshotDirectory next to the test file. On failure name.received.png and name.diff.png are written and the message lists the changed regions and elements ("text "FROM" moved +12 dots"). Accept with ZPLCORE_ACCEPT_SNAPSHOTS=1 or zplcore snapshot accept <dir>.
# NoClipping()LabelAssertionsEvery element lies completely on the label (nothing cut off at the ^PW/^LL edge).
# NoOverlaps(int toleranceDots = 0)LabelAssertionsNo two elements' ink overlaps (text over text, text over barcode, lines through text …). Outlined boxes count with their four sides only and reverse (^FR) fields never count, so framed and inverted designs pass. toleranceDots: Overlaps of at most this many dots in width or height are ignored (touching lines).
# OnLabel(int index)LabelAssertionsSwitches to label index (0-based, print order; ^PQ copies are not separate labels).
# Renders(int? dpi = default, ZplDiagnosticSeverity failOn = ZplDiagnosticSeverity.Warning)LabelAssertionsThe ZPL renders at least one label and without render diagnostics of failOn or above (default warnings: invalid barcode data, missing fonts and graphics, malformed commands). dpi: Renders at this resolution instead of the test resolution (e.g. to prove a 203 dpi label also works at 300 dpi). · failOn: Lowest severity that fails.
# Satisfies(Func<ComplianceLabel, bool> predicate, string because, string expression = "")LabelAssertionsCustom assertion on the current label.
# Text(string text, int? index = default)TextAssertionsSelects one text field (exact content, else substring, else substring ignoring case). Fails when nothing or – without index – more than one text matches.
PrinterFitContext What a printer-fit check sees: the ZPL, the resolution it was rendered at and every measured label. record7 members#
public record PrinterFitContext

What a printer-fit check sees: the ZPL, the resolution it was rendered at and every measured label.

Constructors

SignatureDescription
# PrinterFitContext(string Zpl, int Dpi, IReadOnlyList<ComplianceLabel> Labels)What a printer-fit check sees: the ZPL, the resolution it was rendered at and every measured label. Zpl: The ZPL under test. · Dpi: Resolution the labels were rendered and measured at. · Labels: Measured labels (elements with bounds in dots, ink).

Properties

PropertyTypeDescription
DefaultLabelLengthMm { get; init; }double?Label length used when the ZPL sets no ^LL (null: the checker's default).
Dpi { get; init; }intResolution the labels were rendered and measured at.
FieldValues { get; init; }IReadOnlyDictionary<int, string>^FN values the labels were rendered with (null: none).
Labels { get; init; }IReadOnlyList<ComplianceLabel>Measured labels (elements with bounds in dots, ink).
Zpl { get; init; }stringThe ZPL under test.

Methods

Method SignatureReturnsDescription
# Deconstruct(out string Zpl, out int Dpi, out IReadOnlyList<ComplianceLabel> Labels)void
PrinterFitIssue A reason why a label does not fit a printer. record7 members#
public record PrinterFitIssue

A reason why a label does not fit a printer.

Constructors

SignatureDescription
# PrinterFitIssue(string Code, string Message, int LabelIndex = -1, ComplianceElement? Element = default, ZplDiagnosticSeverity Severity = ZplDiagnosticSeverity.Error)A reason why a label does not fit a printer. Code: Stable id, e.g. "ZT1201" (built-in) or the id of the profile's own rule. · Message: What does not fit. · LabelIndex: 0-based label, -1 for the whole job. · Element: The element that does not fit, if any. · Severity: Error fails LabelAssertions.FitsPrinter; warnings fail only with failOnWarnings.

Properties

PropertyTypeDescription
Code { get; init; }stringStable id, e.g. "ZT1201" (built-in) or the id of the profile's own rule.
Element { get; init; }ComplianceElementThe element that does not fit, if any.
LabelIndex { get; init; }int0-based label, -1 for the whole job.
Message { get; init; }stringWhat does not fit.
Severity { get; init; }ZplDiagnosticSeverityError fails LabelAssertions.FitsPrinter; warnings fail only with failOnWarnings.

Methods

Method SignatureReturnsDescription
# Deconstruct(out string Code, out string Message, out int LabelIndex, out ComplianceElement Element, out ZplDiagnosticSeverity Severity)void
PrinterProfileFit A Printer Twin profile (PrinterProfiles) as IZplPrinterFit: LabelAssertions.FitsPrinter and zplcore check --printer ZD421d-203 … class5 members#
public sealed class PrinterProfileFit : IZplPrinterFit

A Printer Twin profile (PrinterProfiles) as IZplPrinterFit: LabelAssertions.FitsPrinter and zplcore check --printer ZD421d-203 run ZplPrinterTwin.Check (printhead width and clipped fields, maximum length, resolution, firmware, options, fonts, encodings, memory, speed/darkness) and report its ZPL5xxx diagnostics. Unknown profile facts (ZPL5001) are infos and never fail a test.

Constructors

SignatureDescription
# PrinterProfileFit(PrinterProfile profile, ZplTwinOptions? options = default)Wraps profile; options override what the test context supplies. profile: The printer model profile (built-in or loaded with PrinterProfiles.Load). · options: Twin options. By default the design resolution is the resolution the test renders at (a different profile resolution is reported as ZPL5104), and the field values and default label length come from the test.

Properties

PropertyTypeDescription
Name { get; }string
Profile { get; }PrinterProfileThe wrapped profile.

Methods

Method SignatureReturnsDescription
# Check(PrinterFitContext context)IEnumerable<PrinterFitIssue>
# ToString()string
PrinterProfileFitExtensions PrinterProfile helpers for the assertions. class1 member#
public static class PrinterProfileFitExtensions

PrinterProfile helpers for the assertions.

Methods

Method SignatureReturnsDescription
extension # AsPrinterFit(this PrinterProfile profile, ZplTwinOptions? options = default)IZplPrinterFitThe profile as IZplPrinterFit (see PrinterProfileFit).
PrinterSpec Data-sheet printer limits: resolution, maximum print width and label length. Checks that the label was designed for the printer… class10 members#
public sealed class PrinterSpec : IZplPrinterFit

Data-sheet printer limits: resolution, maximum print width and label length. Checks that the label was designed for the printer's resolution and that no ink lies outside the printable width.

Constructors

SignatureDescription
# PrinterSpec(string name, int dpi, double printWidthMm, double? maxLabelLengthMm = default)Creates a spec. name: Model name for messages. · dpi: Printhead resolution. · printWidthMm: Maximum print width (printhead width). · maxLabelLengthMm: Maximum label length, null when not limited.

Properties

PropertyTypeDescription
Dpi { get; }intPrinthead resolution.
MaxLabelLengthMm { get; }double?Maximum label length in mm (null: not limited).
Name { get; }string
PrintWidthMm { get; }doubleMaximum print width in mm.

Fields & Constants

FieldTypeDescription
const LabelLengthRule = "ZT1203"stringBuilt-in rule ids.
const PrintWidthRule = "ZT1202"stringBuilt-in rule ids.
const ResolutionRule = "ZT1201"stringBuilt-in rule ids.

Methods

Method SignatureReturnsDescription
# Check(PrinterFitContext context)IEnumerable<PrinterFitIssue>
# ToString()string
SemanticDiff Element-level diff of two renders (used by snapshots and by zplcore check --baseline). class2 members#
public static class SemanticDiff

Element-level diff of two renders (used by snapshots and by zplcore check --baseline).

Methods

Method SignatureReturnsDescription
static # Compare(SnapshotDocument before, SnapshotDocument after, int toleranceDots = 0)IReadOnlyList<ElementChange>Compares two semantic snapshots label by label (a label count change is reported as added/removed elements).
static # Compare(IReadOnlyList<SnapshotElement> before, IReadOnlyList<SnapshotElement> after, int labelIndex = 0, int dpi = 203, int toleranceDots = 0)IReadOnlyList<ElementChange>Compares the elements of two versions of one label. Moves of up to toleranceDots are ignored.
SnapshotDocument Semantic snapshot (name.approved.json next to the approved PNGs): resolution, label sizes and the elements with position and co… record9 members#
public record SnapshotDocument

Semantic snapshot (name.approved.json next to the approved PNGs): resolution, label sizes and the elements with position and content, so a failing snapshot explains what changed ("text "FROM" moved 12 dots down", "barcode data changed") and not only how many pixels.

Constructors

SignatureDescription
# SnapshotDocument()

Properties

PropertyTypeDescription
Dpi { get; init; }intResolution of the render.
Engine { get; init; }stringzplCore version that wrote the snapshot.
Format { get; init; }stringFormat marker ("zplcore-snapshot").
Labels { get; init; }IReadOnlyList<SnapshotLabel>The labels with their elements.
SourceSha256 { get; init; }stringSHA-256 of the ZPL source (informational: the snapshot compares the render, not the source).
Version { get; init; }intFormat version (1).

Methods

Method SignatureReturnsDescription
static # FromJson(string json)SnapshotDocumentReads a snapshot document; null when the JSON is not one.
# ToJson()stringIndented JSON (camelCase).
SnapshotElement One element of a semantic snapshot: what was drawn where (dots), independent of the pixels. record12 members#
public record SnapshotElement

One element of a semantic snapshot: what was drawn where (dots), independent of the pixels.

Constructors

SignatureDescription
# SnapshotElement(string Kind, string Command, string Content, int X, int Y, int Width, int Height, string? Symbology = default, int Line = 0)One element of a semantic snapshot: what was drawn where (dots), independent of the pixels. Kind: text, barcode, shape, graphic or other. · Command: ZPL command with prefix, e.g. "^A0", "^BC", "^GB". · Content: Text as printed, barcode data as the scanner reads it (control characters as ‹GS›), shape/graphic parameters. · X: Left edge in dots. · Y: Top edge in dots. · Width: Width in dots. · Height: Height in dots. · Symbology: Barcode symbology (barcodes only). · Line: 1-based ZPL source line (0 when unknown).

Properties

PropertyTypeDescription
Command { get; init; }stringZPL command with prefix, e.g. "^A0", "^BC", "^GB".
Content { get; init; }stringText as printed, barcode data as the scanner reads it (control characters as ‹GS›), shape/graphic parameters.
Height { get; init; }intHeight in dots.
Kind { get; init; }stringtext, barcode, shape, graphic or other.
Label { get; }string"text "FROM"", "barcode ^BC Code128 "(00)…"".
Line { get; init; }int1-based ZPL source line (0 when unknown).
Symbology { get; init; }stringBarcode symbology (barcodes only).
Width { get; init; }intWidth in dots.
X { get; init; }intLeft edge in dots.
Y { get; init; }intTop edge in dots.

Methods

Method SignatureReturnsDescription
# Deconstruct(out string Kind, out string Command, out string Content, out int X, out int Y, out int Width, out int Height, out string Symbology, out int Line)void
SnapshotLabel One label of a semantic snapshot. record7 members#
public record SnapshotLabel

One label of a semantic snapshot.

Constructors

SignatureDescription
# SnapshotLabel(int Index, int Width, int Height, string Image, IReadOnlyList<SnapshotElement> Elements)One label of a semantic snapshot.

Properties

PropertyTypeDescription
Elements { get; init; }IReadOnlyList<SnapshotElement>
Height { get; init; }int
Image { get; init; }string
Index { get; init; }int
Width { get; init; }int

Methods

Method SignatureReturnsDescription
# Deconstruct(out int Index, out int Width, out int Height, out string Image, out IReadOnlyList<SnapshotElement> Elements)void
SnapshotLabelResult Comparison result of one label of a snapshot. record12 members#
public record SnapshotLabelResult

Comparison result of one label of a snapshot.

Constructors

SignatureDescription
# SnapshotLabelResult()

Properties

PropertyTypeDescription
AllowedPixels { get; init; }longChanged pixels the tolerance allows for this label.
ApprovedPath { get; init; }stringApproved image path.
Area { get; init; }longLabel area in pixels.
ChangedPercent { get; }doubleChanged pixels in percent of the label area.
ChangedPixels { get; init; }longChanged pixels after the shift tolerance.
DiffPath { get; init; }stringDiff overlay path (written on failure): grey unchanged, red removed, green added, blue boxes around changed regions.
Index { get; init; }int0-based label index.
Passed { get; init; }boolWithin tolerance.
ReceivedPath { get; init; }stringReceived image path (written on failure).
Regions { get; init; }IReadOnlyList<ZplDiffRegion>Changed regions (largest first).
SizeChange { get; init; }stringApproved and received label sizes differ ("812 × 1218 → 812 × 1200"), else null.
SnapshotOutcome Outcome of a snapshot comparison. enum4 members#
public enum SnapshotOutcome

Outcome of a snapshot comparison.

Values

NameValueDescription
Match0Within tolerance.
Missing1No approved snapshot: the received files were written for review.
Mismatch2Differs beyond the tolerance (or content changed): received and diff files were written.
Accepted3Accept mode: the approved snapshot was written (new or replaced).
SnapshotResult Result of SnapshotStore.Verify. record8 members#
public record SnapshotResult

Result of SnapshotStore.Verify.

Constructors

SignatureDescription
# SnapshotResult()

Properties

PropertyTypeDescription
ApprovedJsonPath { get; init; }stringPath of the semantic snapshot.
Changes { get; init; }IReadOnlyList<ElementChange>Semantic changes against the approved snapshot (moves within the shift tolerance are not listed).
LabelCountChange { get; init; }stringApproved / received label counts differ.
Labels { get; init; }IReadOnlyList<SnapshotLabelResult>Per-label comparison.
required Name { get; init; }stringSnapshot name (file-safe).
Outcome { get; init; }SnapshotOutcomeOutcome.
Passed { get; }boolMatch or accepted.
SnapshotStore Snapshot folder with the approval workflow. Files per snapshot name: name.approved.png (label 1), name.label2.approved.png … – … class7 members#
public sealed class SnapshotStore

Snapshot folder with the approval workflow. Files per snapshot name: name.approved.png (label 1), name.label2.approved.png … – commit thesename.approved.json – semantic snapshot (elements, positions, data) – commit it tooname.received.png / name.received.json / name.diff.png – written on failure; add *.received.* and *.diff.png to .gitignore Accept with ZPLCORE_ACCEPT_SNAPSHOTS=1, zplcore snapshot accept <dir> or by renaming received to approved.

Constructors

SignatureDescription
# SnapshotStore(string directory)Opens (and creates on write) the folder.

Properties

PropertyTypeDescription
Directory { get; }stringAbsolute folder path.

Methods

Method SignatureReturnsDescription
static # AcceptAll(string directory)IReadOnlyList<string>Promotes every received snapshot in directory to approved (received → approved, diff removed). Returns the accepted snapshot names.
static # Explain(SnapshotResult r, SnapshotTolerance tolerance, int dpi)IEnumerable<(string, string)>Human-readable explanation of a failed result (used in assertion messages and the CLI).
static # ImageName(string name, int index, string kind)stringFile name of label index's image ("approved", "received" or "diff").
static # SafeName(string name)stringMakes a snapshot or test name safe as a file name (keeps letters, digits, - _ . and spaces as -).
# Verify(string name, SnapshotSubject subject, SnapshotTolerance tolerance, bool accept, bool failOnMissing = true)SnapshotResultCompares subject with the approved snapshot name; writes received and diff files on failure, removes stale ones on success, and writes the approved files in accept mode.
SnapshotSubject What a snapshot stores for a render: one PNG per label and the semantic document. record5 members#
public record SnapshotSubject

What a snapshot stores for a render: one PNG per label and the semantic document.

Constructors

SignatureDescription
# SnapshotSubject(IReadOnlyList<byte[]> Pngs, SnapshotDocument Document)What a snapshot stores for a render: one PNG per label and the semantic document.

Properties

PropertyTypeDescription
Document { get; init; }SnapshotDocument
Pngs { get; init; }IReadOnlyList<byte[]>

Methods

Method SignatureReturnsDescription
static # Create(IReadOnlyList<byte[]> pngs, IReadOnlyList<ComplianceLabel> labels, int dpi, string zpl, string name)SnapshotSubjectBuilds the subject from 1-bit PNGs and the measured labels.
# Deconstruct(out IReadOnlyList<byte[]> Pngs, out SnapshotDocument Document)void
SnapshotTolerance How much a rendered label may differ from its approved snapshot. A label passes when the changed pixels (after ignoring ink tha… record10 members#
public record SnapshotTolerance

How much a rendered label may differ from its approved snapshot. A label passes when the changed pixels (after ignoring ink that moved by at most SnapshotTolerance.ShiftPixels) are at most SnapshotTolerance.MaxChangedPixels or at most SnapshotTolerance.MaxChangedPercent % of the label area – and, unless SnapshotTolerance.IgnoreContentChanges, when no element was added, removed or changed its text/data (a changed digit can be a handful of pixels, but it is never "noise").

Constructors

SignatureDescription
# SnapshotTolerance()

Properties

PropertyTypeDescription
static Exact { get; }SnapshotTolerancePixel-identical, no content change.
IgnoreContentChanges { get; init; }boolAccept added/removed/changed elements as long as the pixel tolerance holds (default false).
MaxChangedPercent { get; init; }doubleChanged pixels that are accepted, in percent of the label area (0–100).
MaxChangedPixels { get; init; }intChanged pixels that are accepted (absolute).
ShiftPixels { get; init; }intInk that moved by up to this many dots counts as unchanged (anti-jitter for cross-platform font rasterising).

Methods

Method SignatureReturnsDescription
# Allowed(long area)longAllowed changed pixels for a label of area pixels.
static # Percent(double percent)SnapshotToleranceUp to percent % changed pixels.
static # Pixels(int pixels)SnapshotToleranceUp to pixels changed pixels.
# WithShift(int dots)SnapshotToleranceIgnores ink that moved by up to dots dots.
TextAssertions Assertions on one text field. class2 members#
public sealed class TextAssertions : ElementAssertions<TextAssertions, ComplianceText>

Assertions on one text field.

Methods

Method SignatureReturnsDescription
# HasCharHeight(double atLeastMm)TextAssertionsThe measured character (cap/digit) height is at least atLeastMm mm.
# HasContent(string expected)TextAssertionsThe field prints exactly expected.
ZplAssert Entry point of the semantic label assertions. ZplAssert.Label(zpl) renders the label once and returns a fluent LabelAssertions … class4 members#
public static class ZplAssert

Entry point of the semantic label assertions. ZplAssert.Label(zpl) renders the label once and returns a fluent LabelAssertions object; every assertion checks what the label prints (decoded barcodes, measured positions, compliance rules) and throws a ZplAssertionException with the element position, the ZPL line and an annotated image path when it fails.

Properties

PropertyTypeDescription
static Settings { get; }ZplAssertSettingsProcess-wide defaults (snapshot folder, failure images, exception adapter). Set them once, e.g. in a module initializer.

Methods

Method SignatureReturnsDescription
static # Label(string zpl, ZplTestOptions? options = default)LabelAssertionsStarts assertions on ZPL code (all labels of the job; assertions apply to label 0 unless LabelAssertions.OnLabel selects another). zpl: ZPL II code (one or more ^XA…^XZ formats). · options: Resolution, label size, ^FN values …; null uses ZplAssert.Settings. · testName: Filled by the compiler: the calling test method, used to name failure images. · testFile: Filled by the compiler: the calling source file, used to find the snapshot folder.
static # Label(Label label, ZplTestOptions? options = default)LabelAssertionsStarts assertions on a label model (Label), converted with Label.ToZpl at the test resolution.
static # LabelFile(string path, ZplTestOptions? options = default)LabelAssertionsStarts assertions on a .zpl file or a label JSON file (Label.FromJson).
ZplAssertSettings Process-wide defaults for ZplAssert. class13 members#
public sealed class ZplAssertSettings

Process-wide defaults for ZplAssert.

Constructors

SignatureDescription
# ZplAssertSettings()

Properties

PropertyTypeDescription
AcceptSnapshots { get; set; }boolAccept snapshots instead of failing: true when ZplAssertSettings.AcceptEnvironmentVariable is set to 1/true/yes. Can also be set in code (e.g. from a test run parameter).
Dpi { get; set; }intDefault print resolution (203 dpi).
ExceptionFactory { get; set; }Func<ZplAssertionException, Exception>Creates the exception that is thrown for failed assertions. Default ZplTestFrameworks.AutoDetect (NUnit/MSTest assertion exceptions when that framework is loaded, else ZplAssertionException).
FailOnMissingSnapshot { get; set; }boolFail when an approved snapshot is missing (default true). The received image is always written so it can be reviewed and accepted; with false a missing snapshot is written as approved and the assertion passes.
FailureImageDirectory { get; set; }stringFolder of the failure images (default: zplcore-failures in the test output folder, or the folder in ZplAssertSettings.FailureDirectoryEnvironmentVariable).
HeightMm { get; set; }doubleDefault label height in mm when the ZPL has no ^LL (6 in).
SnapshotDirectory { get; set; }stringFolder for snapshots, relative to the test source file (default __snapshots__ next to the test class) or absolute.
SnapshotTolerance { get; set; }SnapshotToleranceDefault pixel tolerance of LabelAssertions.MatchesSnapshot (exact).
WidthMm { get; set; }doubleDefault label width in mm when the ZPL has no ^PW (4 in).
WriteFailureImages { get; set; }boolWrite an annotated PNG for every failure (failing elements outlined) and put its path into the message. Default on.

Fields & Constants

FieldTypeDescription
const AcceptEnvironmentVariable = "ZPLCORE_ACCEPT_SNAPSHOTS"stringEnvironment variable that accepts snapshots: 1/true writes every received snapshot as approved.
const FailureDirectoryEnvironmentVariable = "ZPLCORE_FAILURE_DIR"stringEnvironment variable that overrides ZplAssertSettings.FailureImageDirectory.
ZplAssertionException Thrown when a label assertion fails. Works with every test framework (any exception fails a test); see ZplAssertSettings.Except… class2 members#
public sealed class ZplAssertionException : Exception

Thrown when a label assertion fails. Works with every test framework (any exception fails a test); see ZplAssertSettings.ExceptionFactory and ZplTestFrameworks to throw the framework's own assertion exception instead. ZplAssertionException.Failures holds the structured results.

Constructors

SignatureDescription
# ZplAssertionException(IReadOnlyList<ZplAssertionFailure> failures)Creates the exception for one or more failures.

Properties

PropertyTypeDescription
Failures { get; }IReadOnlyList<ZplAssertionFailure>Every failure (more than one inside a ZplAssertionScope).
ZplAssertionFailure One failed label assertion: what was expected, what the label prints instead, where (label, element position, ZPL line) and the… record11 members#
public record ZplAssertionFailure

One failed label assertion: what was expected, what the label prints instead, where (label, element position, ZPL line) and the image files written for it.

Constructors

SignatureDescription
# ZplAssertionFailure()

Properties

PropertyTypeDescription
ApprovedPath { get; init; }stringSnapshot assertions: the approved image the label was compared with.
required Assertion { get; init; }stringThe assertion chain that failed, e.g. Barcode("SSCC").Decodes("(00)…").
Column { get; init; }int1-based ZPL source column (0 when unknown).
Details { get; init; }IReadOnlyList<(string, string)>Details (label, element, source excerpt, measured values), one entry per line.
DiffPath { get; init; }stringSnapshot assertions: overlay of approved and received (black = both, red = only approved, blue = only received).
ImagePath { get; init; }stringThe label rendered with the failing elements outlined (red) and related elements (orange), or null.
LabelIndex { get; init; }int0-based label index (print order), -1 when the failure is not tied to one label.
Line { get; init; }int1-based ZPL source line of the failing element (0 when unknown).
ReceivedPath { get; init; }stringSnapshot assertions: the image the label renders now (written next to the approved one).
required Summary { get; init; }stringOne-line statement of what is wrong.
ZplAssertionScope Collects every failed label assertion inside the scope and throws them together when the scope is disposed, so one test run sho… class3 members#
public sealed class ZplAssertionScope : IDisposable

Collects every failed label assertion inside the scope and throws them together when the scope is disposed, so one test run shows all problems of a label (like FluentAssertions' AssertionScope). Scopes flow with async calls.

Constructors

SignatureDescription
# ZplAssertionScope()Opens a scope (nested scopes report to the outermost one).

Properties

PropertyTypeDescription
Failures { get; }IReadOnlyList<ZplAssertionFailure>Failures collected so far.

Methods

Method SignatureReturnsDescription
# Dispose()voidCloses the scope and throws when assertions failed.
ZplPrinterFit Factory helpers for IZplPrinterFit. class1 member#
public static class ZplPrinterFit

Factory helpers for IZplPrinterFit.

Methods

Method SignatureReturnsDescription
static # From(string name, Func<PrinterFitContext, IEnumerable<PrinterFitIssue>> check)IZplPrinterFitWraps a delegate (e.g. around a Printer Twin report) as IZplPrinterFit.
ZplSelectors How LabelAssertions.Barcode and LabelAssertions.Text find elements. The first rule that matches anything wins. class1 member#
public static class ZplSelectors

How LabelAssertions.Barcode and LabelAssertions.Text find elements. The first rule that matches anything wins.

Barcodes: #2 (0-based index among the barcodes of the label) · a command (^BC, BQ) · a symbology (Code128, QR, DataMatrix, GS1-128, EAN13 …) · a GS1 key (SSCC, GTIN, BATCH, SERIAL, (00), AI 37) · otherwise a substring of the encoded data or the interpretation line. Texts: exact content · substring (case-sensitive) · substring (ignoring case).

Properties

PropertyTypeDescription
static Gs1Keys { get; }IReadOnlyDictionary<string, string>GS1 key names accepted as barcode selectors and their Application Identifier.
ZplTestFrameworks Optional adapters that turn a ZplAssertionException into the assertion exception of a test framework, so the framework reports … class4 members#
public static class ZplTestFrameworks

Optional adapters that turn a ZplAssertionException into the assertion exception of a test framework, so the framework reports a failed assertion instead of an unexpected exception (NUnit shows "Error" for foreign exceptions, MSTest prints "threw exception"). They work by reflection: this package does not reference any test framework. The original exception is kept as Exception.InnerException.

The default (ZplTestFrameworks.AutoDetect) picks NUnit or MSTest when exactly one of them is loaded and otherwise throws ZplAssertionException unchanged – which xUnit (v2 and v3), TUnit and every other runner report as a normal test failure.

Properties

PropertyTypeDescription
static AutoDetect { get; }Func<ZplAssertionException, Exception>Detects NUnit or MSTest from the loaded assemblies on the first failure (default).
static MSTest { get; }Func<ZplAssertionException, Exception>Throws MSTest's AssertFailedException (falls back to the original when MSTest is not loaded).
static NUnit { get; }Func<ZplAssertionException, Exception>Throws NUnit.Framework.AssertionException (falls back to the original when NUnit is not loaded).
static None { get; }Func<ZplAssertionException, Exception>Throws ZplAssertionException as it is.
ZplTestOptions Per-label settings of ZplAssert.Label. Unset values come from ZplAssert.Settings. record11 members#
public record ZplTestOptions

Per-label settings of ZplAssert.Label. Unset values come from ZplAssert.Settings.

Constructors

SignatureDescription
# ZplTestOptions()

Properties

PropertyTypeDescription
AcceptSnapshots { get; init; }bool?Accept snapshots of this label (overrides ZplAssertSettings.AcceptSnapshots).
Clock { get; init; }DateTimeClock for ^FC/^SL date fields, fixed by default (2026-01-01 12:00) so snapshots stay stable.
Dpi { get; init; }int?Print resolution in dpi (152, 203, 300, 600).
FailureImageDirectory { get; init; }stringFailure image folder for this label (overrides ZplAssertSettings.FailureImageDirectory).
FieldValues { get; init; }IReadOnlyDictionary<int, string>Values for ^FN fields (also in formats recalled with ^XF).
HeightMm { get; init; }double?Label height in mm when the ZPL has no ^LL.
Robustness { get; init; }boolRun the scan-proof robustness simulations (slower) for barcode assertions.
SnapshotDirectory { get; init; }stringSnapshot folder for this label (overrides ZplAssertSettings.SnapshotDirectory).
WidthMm { get; init; }double?Label width in mm when the ZPL has no ^PW.
WriteFailureImages { get; init; }bool?Write failure images for this label (overrides ZplAssertSettings.WriteFailureImages).

ZplCore.Testing.Check #

14 types

Batch label check runner behind 'zplcore check' (ZplCheck, ZplCheckOptions, ZplCheckResult) with JUnit XML, SARIF 2.1.0, JSON and Markdown PR reports.

BaselineState How a file compares with its baseline version. enum4 members#
public enum BaselineState

How a file compares with its baseline version.

Values

NameValueDescription
None0No baseline requested.
Added1Not in the baseline: a new label file.
Unchanged2Renders identically and no element changed.
Changed3Pixels or elements changed.
CheckCase One check of a file (a JUnit test case). record7 members#
public record CheckCase

One check of a file (a JUnit test case).

Constructors

SignatureDescription
# CheckCase(string Name, CheckStatus Status, IReadOnlyList<CheckFinding> Findings, double Seconds, string? Message = default)One check of a file (a JUnit test case).

Properties

PropertyTypeDescription
Findings { get; init; }IReadOnlyList<CheckFinding>
Message { get; init; }string
Name { get; init; }string
Seconds { get; init; }double
Status { get; init; }CheckStatus

Methods

Method SignatureReturnsDescription
# Deconstruct(out string Name, out CheckStatus Status, out IReadOnlyList<CheckFinding> Findings, out double Seconds, out string Message)void
CheckFinding One finding of zplcore check with its source position. record12 members#
public record CheckFinding

One finding of zplcore check with its source position.

Constructors

SignatureDescription
# CheckFinding()

Properties

PropertyTypeDescription
Bounds { get; init; }ComplianceRect?Area on the label in dots.
required Check { get; init; }stringCheck that reported it ("render", "layout", "comply gs1-logistic", "scan-proof", "snapshot", "printer", "baseline").
Column { get; init; }int1-based column (0 when unknown).
LabelIndex { get; init; }int0-based label, -1 for the file.
Length { get; init; }intLength of the source span (0 when unknown).
Line { get; init; }int1-based line (0 when unknown).
required Message { get; init; }stringHuman-readable message, prefixed with the label number.
Offset { get; init; }intCharacter offset into the ZPL (-1 when unknown).
required RuleId { get; init; }stringRule id: ZPL3xxx (compliance), SPxxxx (scan-proof), ZTxxxx (testing: render, layout, snapshot, baseline, printer).
required Severity { get; init; }CheckSeveritySeverity.
Suggestion { get; init; }stringOptional fix suggestion.
CheckImages Rendered images of one label for the report (paths relative to ZplCheckOptions.ReportDirectory). record7 members#
public record CheckImages

Rendered images of one label for the report (paths relative to ZplCheckOptions.ReportDirectory).

Constructors

SignatureDescription
# CheckImages(int LabelIndex, string Before, string After, string Diff, long ChangedPixels)Rendered images of one label for the report (paths relative to ZplCheckOptions.ReportDirectory).

Properties

PropertyTypeDescription
After { get; init; }string
Before { get; init; }string
ChangedPixels { get; init; }long
Diff { get; init; }string
LabelIndex { get; init; }int

Methods

Method SignatureReturnsDescription
# Deconstruct(out int LabelIndex, out string Before, out string After, out string Diff, out long ChangedPixels)void
CheckSeverity Severity of a check finding (maps to SARIF note / warning / error). enum3 members#
public enum CheckSeverity

Severity of a check finding (maps to SARIF note / warning / error).

Values

NameValueDescription
Note0Information (baseline changes, advice); never fails unless --fail-on note.
Warning1Probably a problem; fails with --fail-on warning.
Error2A problem; fails by default.
CheckStatus Result of one check (a JUnit test case). enum4 members#
public enum CheckStatus

Result of one check (a JUnit test case).

Values

NameValueDescription
Passed0No finding at or above ZplCheckOptions.FailOn.
Failed1Findings at or above ZplCheckOptions.FailOn.
Error2The check could not run (input error, exception).
Skipped3Not run (e.g. JSON that is no label).
CheckedFile Everything zplcore check found for one file. class13 members#
public sealed class CheckedFile

Everything zplcore check found for one file.

Constructors

SignatureDescription
# CheckedFile()

Properties

PropertyTypeDescription
Baseline { get; init; }BaselineStateComparison with the baseline version.
Cases { get; init; }IReadOnlyList<CheckCase>The checks that ran (JUnit test cases).
Changes { get; init; }IReadOnlyList<ElementChange>Semantic changes against the baseline.
Failed { get; }boolA check failed or could not run.
Findings { get; }IEnumerable<CheckFinding>All findings of all checks.
Images { get; init; }IReadOnlyList<CheckImages>Report images (with ZplCheckOptions.ReportDirectory).
LabelCount { get; init; }intNumber of labels the file prints.
required Path { get; init; }stringAbsolute path.
required RelativePath { get; init; }stringPath relative to the root, with forward slashes (SARIF artifact URI, JUnit suite name).
Seconds { get; init; }doubleTime spent on the file.
Skipped { get; init; }boolLabel JSON that is no label (e.g. package.json): skipped.

Methods

Method SignatureReturnsDescription
# Count(CheckSeverity s)intNumber of findings of severity s.
LabelSource Reads label files for ZplCheck: ZPL (.zpl, .prn, .txt …) and label JSON (Label.FromJson). class5 members#
public static class LabelSource

Reads label files for ZplCheck: ZPL (.zpl, .prn, .txt …) and label JSON (Label.FromJson).

Properties

PropertyTypeDescription
static DefaultPatterns { get; }IReadOnlyList<string>Default patterns of zplcore check without arguments.

Methods

Method SignatureReturnsDescription
static # Expand(IEnumerable<string> patterns, string root)IReadOnlyList<string>Expands files and glob patterns (**/*.zpl, labels/*.json, !**/draft/** to exclude) relative to root. Existing file paths are taken as they are. Result: absolute paths, sorted, distinct.
static # IsLabelJson(string json)boolTrue when json is a label JSON object (items, width, height).
static # Load(string path, int dpi)stringLoads a label file as ZPL. JSON files must be label JSON (an object with items, width and height); other JSON returns null (not a label, skipped).
static # ReadZpl(byte[] bytes)stringDecodes ZPL bytes like the CLI: UTF-8 (with or without BOM) or UTF-16 with BOM; bytes that are not valid UTF-8 are read like a printer (ZplTextEncoding: code page 850 or the one of the active ^CI).
MarkdownOptions Options of ZplCheckResult.ToMarkdown. class7 members#
public sealed class MarkdownOptions

Options of ZplCheckResult.ToMarkdown.

Constructors

SignatureDescription
# MarkdownOptions()

Properties

PropertyTypeDescription
ArtifactUrl { get; set; }stringLink to the uploaded report artifact / workflow run, shown when images are left out.
DetailsForUnchanged { get; set; }boolShow files that passed and did not change (default false: only listed in the table).
ImageUrl { get; set; }Func<string, string>Turns a report image path (relative to the report folder) into a URL; null leaves images out (e.g. job summaries without hosting).
Marker { get; set; }stringHidden marker that identifies the comment for updates (<!-- zplcore-label-check -->).
MaxLength { get; set; }intMaximum characters (GitHub comments allow 65 536).
Title { get; set; }stringHeading.
ZplCheck The label check runner behind zplcore check: renders every label file, runs the selected checks (render, layout, compliance pac… class4 members#
public static class ZplCheck

The label check runner behind zplcore check: renders every label file, runs the selected checks (render, layout, compliance packs, scan-proof, printer fit, snapshots, baseline diff) and returns a result that writes text, JUnit XML, SARIF 2.1.0, JSON and a Markdown PR summary.

Fields & Constants

FieldTypeDescription
const MaxImagesPerFile = 4intAt most this many labels per file get report images.

Methods

Method SignatureReturnsDescription
static # CheckFile(string path, string root, ZplCheckOptions options)CheckedFileChecks one file.
static # Run(ZplCheckOptions options)ZplCheckResultRuns all checks on the files matched by ZplCheckOptions.Inputs.
static # SnapshotName(string relativePath)stringSnapshot name of a file: its relative path without extension, folders joined with "-".
ZplCheck.Rules Rule ids of the testing checks (ZT…). Compliance (ZPL3xxx) and scan-proof (SPxxxx) keep their own ids. class13 members#
public static class ZplCheck.Rules

Rule ids of the testing checks (ZT…). Compliance (ZPL3xxx) and scan-proof (SPxxxx) keep their own ids.

Properties

PropertyTypeDescription
static All { get; }IReadOnlyList<(string, string, string, CheckSeverity)>Id, name, description and default level of every ZT rule (SARIF rule metadata).

Fields & Constants

FieldTypeDescription
const BaselineAdded = "ZT3002"stringNew label file.
const BaselineChanged = "ZT3001"stringThe label changed against the baseline.
const Clipped = "ZT1102"stringAn element extends beyond the label edge.
const GradeBelowMinimum = "ZT1301"stringA barcode grade is below ZplCheckOptions.MinGrade.
const LoadFailed = "ZT1000"stringThe file could not be read or converted.
const NoLabel = "ZT1002"stringThe file prints no label.
const Overlap = "ZT1101"stringInk of two elements overlaps.
const RenderDiagnostic = "ZT1001"stringRender diagnostic (warning/error).
const SnapshotContentChanged = "ZT2003"stringElements added, removed or changed against the snapshot.
const SnapshotMismatch = "ZT2001"stringThe render differs from the approved snapshot.
const SnapshotMissing = "ZT2002"stringNo approved snapshot.
const SnapshotUpdated = "ZT2004"stringThe snapshot was (re)written.
ZplCheckCommand Command line of zplcore check (alias zplcore test, also dotnet zplcore check as a local tool) and zplcore snapshot accept. Live… class6 members#
public static class ZplCheckCommand

Command line of zplcore check (alias zplcore test, also dotnet zplcore check as a local tool) and zplcore snapshot accept. Lives in the Testing package so the CLI, the GitHub Action and tests share it.

Fields & Constants

FieldTypeDescription
const Usage = "zplcore check – semantic label check…"stringHelp text of zplcore check --help.

Methods

Method SignatureReturnsDescription
static # ParsePacks(string value)IReadOnlyList<ComplianceRulePack>"gs1-logistic,ups" or "all" (ids as in zplcore comply).
static # ParsePrinter(string value)PrinterSpec"203:104" or "300:104:991" (dpi : print width mm : max label length mm).
static # ParsePrinterFit(string value)IZplPrinterFit--printer: "203:104" / "300:104:991" (ZplCheckCommand.ParsePrinter) or the id or alias of a Printer Twin profile ("ZD421d-203", "ZD421-203"; PrinterProfileFit).
static # ParseTolerance(string value)SnapshotTolerance"0.5%", "0.5", "25px", "exact".
static # Run(IReadOnlyList<string> args, TextWriter stdout, TextWriter stderr)intRuns check/test/snapshot with args (the command name first). Returns the exit code.
ZplCheckOptions Options of ZplCheck.Run (the zplcore check command line). class20 members#
public sealed class ZplCheckOptions

Options of ZplCheck.Run (the zplcore check command line).

Constructors

SignatureDescription
# ZplCheckOptions()

Properties

PropertyTypeDescription
BaselineDirectory { get; set; }stringFolder with the baseline version of the files (same relative paths), e.g. the PR base checked out by the action.
DisabledRules { get; set; }IReadOnlyCollection<string>Compliance rules to switch off.
Dpi { get; set; }intPrint resolution (default 203 dpi).
FailOn { get; set; }CheckSeverity?Lowest severity that fails the run (null: never fail on findings).
FieldValues { get; set; }IReadOnlyDictionary<int, string>Values for ^FN fields.
HeightMm { get; set; }doubleLabel height when the ZPL has no ^LL (default 6 in).
Inputs { get; set; }IReadOnlyList<string>Files and glob patterns (**/*.zpl, !**/drafts/**); default LabelSource.DefaultPatterns.
Layout { get; set; }boolCheck overlaps (ZT1101) and clipping (ZT1102).
LayoutSeverity { get; set; }CheckSeveritySeverity of layout findings (default warning).
MinGrade { get; set; }ScanProofGrade?With ZplCheckOptions.Verify: fail barcodes below this grade (ZT1301).
Packs { get; set; }IReadOnlyList<ComplianceRulePack>Compliance packs to run (none by default).
Printer { get; set; }IZplPrinterFitPrinter to check against (ZT1201–ZT1203 or the implementation's ids).
ReportDirectory { get; set; }stringFolder for before/after/diff PNGs of changed files and the report files.
Root { get; set; }stringRoot for patterns and relative paths in reports (default: current directory).
SnapshotDirectory { get; set; }stringSnapshot folder: compare every file with its approved snapshot (name = relative path).
SnapshotTolerance { get; set; }SnapshotTolerancePixel tolerance of the snapshot comparison.
UpdateSnapshots { get; set; }boolWrite the current renders as approved snapshots instead of comparing.
Verify { get; set; }boolRun scan-proof: decode every barcode, measure, grade.
WidthMm { get; set; }doubleLabel width when the ZPL has no ^PW (default 4 in).
ZplCheckResult Result of ZplCheck.Run with the CI output formats. class16 members#
public sealed class ZplCheckResult

Result of ZplCheck.Run with the CI output formats.

Properties

PropertyTypeDescription
ChangedFiles { get; }intFiles that changed against the baseline or are new.
ExitCode { get; }intProcess exit code: 0 passed, 1 failed.
Failed { get; }boolTrue when any check failed (findings at ZplCheckOptions.FailOn or above, or a check error).
FailedFiles { get; }intFiles with a failed check.
Files { get; }IReadOnlyList<CheckedFile>Every checked file, sorted by path.
Findings { get; }IEnumerable<CheckFinding>All findings of all files.
Options { get; }ZplCheckOptionsThe options of the run.
Root { get; }stringAbsolute root the relative paths refer to.
Seconds { get; }doubleDuration of the run.

Methods

Method SignatureReturnsDescription
# Count(CheckSeverity s)intNumber of findings of severity s.
# ToGitHubAnnotations()stringGitHub Actions workflow commands (::error file=…,line=…::…): inline annotations without code scanning.
# ToJUnit()stringJUnit XML: one <testsuite> per file, one <testcase> per check. Valid against the Ant/windyroad JUnit schema and the Surefire/Jenkins junit-10 schema (GitHub test reporters, Azure DevOps, GitLab, Jenkins).
# ToJson()stringMachine-readable result (files, cases, findings, changes, images).
# ToMarkdown(MarkdownOptions? options = default)stringMarkdown for a pull request comment or the job summary: overview table, then per changed or failing file the before / after / diff images (when MarkdownOptions.ImageUrl gives URLs), the semantic changes and the findings.
# ToSarif()stringSARIF 2.1.0 with one run (tool "zplCore label check") for GitHub code scanning: rules of the compliance packs (ZPL3xxx, with citations), scan-proof (SPxxxx) and the testing checks (ZTxxxx); results with file, line, column and the label area in properties.boundsDots. Notes (baseline changes) are included as level "note".
# ToText()stringConsole text: one block per file, findings as path:line:col: error RULE: message (compiler style, works with problem matchers).

ZplCore.Tools #

17 types

ZPL developer tools: ZplFormatter, semantic ZplDiff, ZplRescaler (DPI conversion), and ZplGs1Migration (1D to 2D Sunrise 2027).

Gs1LabelMigration Result for one label. class18 members#
public sealed class Gs1LabelMigration

Result for one label.

Properties

PropertyTypeDescription
Carrier { get; }Gs1MigrationCarrierCarrier that was (or would be) added.
DigitalLinkUri { get; }stringThe GS1 Digital Link URI (QR Code carrier) or null.
ElementString { get; }stringThe bracketed element string of the encoded data.
Elements { get; }IReadOnlyList<Gs1Element>Elements encoded in the 2D symbol (GTIN first).
ExtendedLabelLength { get; }int?New label length in dots when Gs1MigrationNoSpaceAction.ExtendLabel was applied.
InsertedZpl { get; }stringThe ZPL field that was inserted (null when nothing was added).
LabelIndex { get; }int0-based label index in print order.
Message { get; }stringOne-line summary.
ModuleDots { get; }intModule size in dots and mm.
ModuleMm { get; }double
Placement { get; }stringWhere the symbol was placed relative to the linear barcode, e.g. "right of ^BE, top-aligned".
QuietZoneDots { get; }intQuiet zone of the 2D symbol in dots (4X for QR Code, 1X for Data Matrix).
Source { get; }Gs1MigrationSourceThe linear barcode the 2D data comes from (null when none was found).
Status { get; }Gs1LabelMigrationStatus
Suggestions { get; }IReadOnlyList<string>Options when the label could not be migrated (space needed, other carrier, longer label …).
SymbolBounds { get; }ComplianceRect?Area of the 2D symbol on the migrated label in dots (verified on the rendered label).
Warnings { get; }IReadOnlyList<string>

Methods

Method SignatureReturnsDescription
# ToString()string
Gs1LabelMigrationStatus Outcome for one label. enum6 members#
public enum Gs1LabelMigrationStatus

Outcome for one label.

Values

NameValueDescription
Migrated0The 2D carrier was added.
AlreadyMigrated1The label already has a GS1 DataMatrix or a Digital Link QR Code / Data Matrix with the same GTIN.
NoGtinCarrier2No EAN/UPC, GS1-128 with (01), ITF-14 or GS1 DataBar with a GTIN was found; nothing to migrate.
NoSpace3No free area with the required quiet zone; see Gs1LabelMigration.Suggestions.
Conflict4The barcodes on the label carry different GTINs, or the data cannot be encoded.
Unsupported5The label uses features the migration does not handle (e.g. a changed command prefix); left unchanged.
Gs1MigrationCarrier 2D carrier that ZplGs1Migration adds next to the linear barcode. enum2 members#
public enum Gs1MigrationCarrier

2D carrier that ZplGs1Migration adds next to the linear barcode.

Values

NameValueDescription
DataMatrixElementString1GS1 DataMatrix (^BX, ECC 200, FNC1 in first position) with GS1 element strings.
Gs1MigrationNoSpaceAction What ZplGs1Migration does when the label has no free area for the 2D carrier. enum2 members#
public enum Gs1MigrationNoSpaceAction

What ZplGs1Migration does when the label has no free area for the 2D carrier.

Values

NameValueDescription
Report0Leave the label unchanged and report the space needed and the options (default).
ExtendLabel1Make the label longer (^LL) and put the 2D carrier below the existing content (needs longer label stock).
Gs1MigrationOptions Settings of ZplGs1Migration.Migrate. class15 members#
public sealed class Gs1MigrationOptions

Settings of ZplGs1Migration.Migrate.

Constructors

SignatureDescription
# Gs1MigrationOptions()

Properties

PropertyTypeDescription
AdditionalElements { get; }IList<Gs1Element>Extra elements to encode, e.g. new("10", "ABC123") or new("17", "271231") when batch and expiry are only printed as text. They must not contradict data found on the label.
CarriedAis { get; }ISet<string>AIs that are carried over from GS1 element strings found on the label (GS1-128, GS1 DataBar Expanded) besides the GTIN. Default: batch/lot (10), production/packaging/best-before/sell-by/expiry dates (11, 13, 15, 16, 17), serial (21), CPV (22), expiry date and time (7003). Clear the set to encode the GTIN only.
Carrier { get; set; }Gs1MigrationCarrier2D carrier to add (default QR Code with GS1 Digital Link URI).
CarryAllAis { get; set; }boolCarry every AI found on the label (overrides Gs1MigrationOptions.CarriedAis).
ClearanceMm { get; set; }doubleMinimum distance in mm between the 2D symbol and other printing (at least its quiet zone; default 1 mm).
DefaultLabelHeightMm { get; set; }doubleLabel height in mm when the ZPL has no ^LL (default 152.4 mm).
DefaultLabelWidthMm { get; set; }doubleLabel width in mm when the ZPL has no ^PW (default 101.6 mm).
DigitalLinkStem { get; set; }stringDomain (and optional path prefix) of the Digital Link URI, e.g. "https://brand.example.com". Default Gs1DigitalLink.DefaultStem (https://id.gs1.org). Ignored for Gs1MigrationCarrier.DataMatrixElementString.
Dpi { get; set; }intPrint resolution in dpi (default 203); all mm values are computed with it.
EdgeMarginMm { get; set; }doubleMinimum distance in mm between the 2D symbol and the label edge (at least its quiet zone; default 1.5 mm).
FieldValues { get; set; }IReadOnlyDictionary<int, string>Values for ^FN fields (as in ZplRenderSettings.FieldValues).
IfNoSpace { get; set; }Gs1MigrationNoSpaceActionWhat to do when no free area is found (default Gs1MigrationNoSpaceAction.Report).
ModuleMm { get; set; }doubleTarget X-dimension (module size) of the 2D symbol in mm (default 0.495, the target of GS1 General Specifications Table 5-46 for retail POS). It is rounded to whole dots and kept within 0.396–0.990 mm; when the symbol does not fit, smaller modules down to the 0.396 mm minimum are tried.
QrErrorCorrection { get; set; }charQR Code error correction level L, M, Q or H (default M). Ignored for Data Matrix.
Gs1MigrationResult Result of ZplGs1Migration.Migrate. class14 members#
public sealed class Gs1MigrationResult

Result of ZplGs1Migration.Migrate.

Properties

PropertyTypeDescription
Changed { get; }bool
Dpi { get; }int
Labels { get; }IReadOnlyList<Gs1LabelMigration>
MigratedZpl { get; }stringThe ZPL with the added 2D carriers (equal to Gs1MigrationResult.OriginalZpl when nothing was added).
OriginalZpl { get; }string
Success { get; }boolEvery label with a GTIN carrier now has a 2D carrier (added or already present) and the sunrise pre-check of the migrated ZPL has no errors (see Gs1MigrationResult.SunriseCheck).
SunriseCheck { get; }ComplianceReportThe "sunrise" compliance pre-check (ZPL3201–ZPL3213) run on Gs1MigrationResult.MigratedZpl. For labels whose only GTIN carrier is GS1-128 or ITF-14 (not scanned at retail POS), ZPL3209 "linear barcode missing" is expected and does not count against Gs1MigrationResult.Success; it stays in the report.
SunriseErrors { get; }IReadOnlyList<ComplianceFinding>Errors of Gs1MigrationResult.SunriseCheck that count: findings on labels with a GTIN carrier (labels without one are not retail items and stay unchanged), except ZPL3209 on labels whose GTIN carrier is not scanned at retail POS.
Warnings { get; }IReadOnlyList<string>Input-wide warnings (no label found …).

Fields & Constants

FieldTypeDescription
const Disclaimer = "GS1 2D migration assistant (pre-chec…"stringWording used in every output: an assistant and pre-check, not a certification.

Methods

Method SignatureReturnsDescription
static # StatusName(Gs1LabelMigrationStatus s)stringDisplay name of a status ("migrated", "no GTIN carrier" …).
# ToJson(bool indented = true)stringJSON report (labels, inserted ZPL, URI, placement in dots and mm, the sunrise check findings).
# ToString()string
# ToText(string? fileName = default)stringHuman-readable report.
Gs1MigrationSource The linear GTIN carrier a migration is based on. record11 members#
public record Gs1MigrationSource

The linear GTIN carrier a migration is based on.

Constructors

SignatureDescription
# Gs1MigrationSource(string Command, ComplianceSymbology Symbology, string Name, string Gtin, IReadOnlyList<Gs1Element> Elements, ComplianceRect SymbolBounds, int Line, bool VariableData)The linear GTIN carrier a migration is based on. Command: ZPL command, e.g. "^BE". · Symbology: Its symbology (EAN-13, UPC-A, EAN-8, UPC-E, GS1-128, ITF-14, GS1 DataBar). · Name: Display name, e.g. "EAN-13". · Gtin: The 14-digit GTIN it encodes. · Elements: All GS1 elements it encodes (GTIN only for EAN/UPC/ITF-14). · SymbolBounds: Bars in dots. · Line: 1-based source line. · VariableData: The data comes from ^FN / ^SN / ^SF (a template field).

Properties

PropertyTypeDescription
Command { get; init; }stringZPL command, e.g. "^BE".
Elements { get; init; }IReadOnlyList<Gs1Element>All GS1 elements it encodes (GTIN only for EAN/UPC/ITF-14).
Gtin { get; init; }stringThe 14-digit GTIN it encodes.
IsRetailPos { get; }boolEAN/UPC or GS1 DataBar (scanned at retail POS); GS1-128 and ITF-14 are not.
Line { get; init; }int1-based source line.
Name { get; init; }stringDisplay name, e.g. "EAN-13".
SymbolBounds { get; init; }ComplianceRectBars in dots.
Symbology { get; init; }ComplianceSymbologyIts symbology (EAN-13, UPC-A, EAN-8, UPC-E, GS1-128, ITF-14, GS1 DataBar).
VariableData { get; init; }boolThe data comes from ^FN / ^SN / ^SF (a template field).

Methods

Method SignatureReturnsDescription
# Deconstruct(out string Command, out ComplianceSymbology Symbology, out string Name, out string Gtin, out IReadOnlyList<Gs1Element> Elements, out ComplianceRect SymbolBounds, out int Line, out bool VariableData)void
ZplDiff Compares two ZPL versions: renders both, builds a pixel diff overlay (removed red, added green, unchanged grey) with changed-pi… class3 members#
public static class ZplDiff

Compares two ZPL versions: renders both, builds a pixel diff overlay (removed red, added green, unchanged grey) with changed-pixel counts and bounding boxes, plus a line diff of the (pretty-printed) sources.

Methods

Method SignatureReturnsDescription
static # Compare(string zplA, string zplB, ZplRenderSettings? settings = default, ZplDiffOptions? options = default)ZplDiffResultRenders zplA and zplB with settings and compares them.
static # CompareImages(SKBitmap a, SKBitmap b, ZplDiffOptions? options = default, int index = 0)ZplLabelDiffPixel diff of two rendered labels (a missing side counts as blank).
static # DiffLines(string a, string b)IReadOnlyList<ZplDiffLine>Line diff (Myers) of two texts; CR LF and LF both end a line.
ZplDiffLine One line of a text diff; ZplDiffLine.LineA/ZplDiffLine.LineB are 1-based (null when the line is not in that side). record6 members#
public record ZplDiffLine

One line of a text diff; ZplDiffLine.LineA/ZplDiffLine.LineB are 1-based (null when the line is not in that side).

Constructors

SignatureDescription
# ZplDiffLine(ZplDiffLineKind Kind, string Text, int? LineA, int? LineB)One line of a text diff; ZplDiffLine.LineA/ZplDiffLine.LineB are 1-based (null when the line is not in that side).

Properties

PropertyTypeDescription
Kind { get; init; }ZplDiffLineKind
LineA { get; init; }int?
LineB { get; init; }int?
Text { get; init; }string

Methods

Method SignatureReturnsDescription
# Deconstruct(out ZplDiffLineKind Kind, out string Text, out int? LineA, out int? LineB)void
ZplDiffLineKind Kind of a line in ZplDiffResult.TextDiff. enum3 members#
public enum ZplDiffLineKind

Kind of a line in ZplDiffResult.TextDiff.

Values

NameValueDescription
Unchanged0
Removed1
Added2
ZplDiffOptions Options of ZplDiff.Compare. class5 members#
public sealed class ZplDiffOptions

Options of ZplDiff.Compare.

Constructors

SignatureDescription
# ZplDiffOptions()

Properties

PropertyTypeDescription
FormatText { get; set; }boolPretty-print both sides before the text diff, so layout-only changes vanish (default true).
IncludeOverlay { get; set; }boolEncode an overlay PNG per label (default true).
MaxRegions { get; set; }intMaximum number of regions reported per label (default 50).
OutlineRegions { get; set; }boolDraw a box around each changed region into the overlay (default false).
ZplDiffRegion Bounding box (in dots) of a group of changed pixels. record7 members#
public record ZplDiffRegion

Bounding box (in dots) of a group of changed pixels.

Constructors

SignatureDescription
# ZplDiffRegion(int X, int Y, int Width, int Height, int ChangedPixels)Bounding box (in dots) of a group of changed pixels.

Properties

PropertyTypeDescription
ChangedPixels { get; init; }int
Height { get; init; }int
Width { get; init; }int
X { get; init; }int
Y { get; init; }int

Methods

Method SignatureReturnsDescription
# Deconstruct(out int X, out int Y, out int Width, out int Height, out int ChangedPixels)void
ZplDiffResult Result of ZplDiff.Compare. class9 members#
public sealed class ZplDiffResult

Result of ZplDiff.Compare.

Constructors

SignatureDescription
# ZplDiffResult()

Properties

PropertyTypeDescription
ChangedPixels { get; }int
LabelCountA { get; init; }int
LabelCountB { get; init; }int
Labels { get; init; }IReadOnlyList<ZplLabelDiff>
LinesAdded { get; }int
LinesRemoved { get; }int
PixelIdentical { get; }boolTrue when all labels render identically (the source text may still differ).
TextDiff { get; init; }IReadOnlyList<ZplDiffLine>
ZplFormatter Pretty-prints or minifies raw ZPL (a shortcut for ZplDocument.Parse + ZplDocument.ToZpl). The output renders pixel-identically … class2 members#
public static class ZplFormatter

Pretty-prints or minifies raw ZPL (a shortcut for ZplDocument.Parse + ZplDocument.ToZpl). The output renders pixel-identically to the input: field data, ^FH escapes and graphic payloads are copied unchanged, and no line break is ever placed inside or directly after field data.

Input whose output would not parse back to the same commands (only possible with exotic ^CC/^CT/^CD combinations) is returned unchanged. Text outside of commands (e.g. stray characters before ^XA) is ignored by printers and dropped.

Methods

Method SignatureReturnsDescription
static # Format(string zpl, ZplOutputOptions? options = default)stringFormats zpl; default: pretty-printed, 2 spaces indentation.
static # Minify(string zpl, bool keepComments = false)stringRemoves all whitespace between commands and the ^FX comments (one label per line).
ZplGs1Migration GS1 2D migration assistant ("Sunrise 2027"): finds the linear GTIN carrier of each label (EAN-13, UPC-A, EAN-8, UPC-E… class3 members#
public static class ZplGs1Migration

GS1 2D migration assistant ("Sunrise 2027"): finds the linear GTIN carrier of each label (EAN-13, UPC-A, EAN-8, UPC-E, GS1-128 with AI (01), ITF-14, GS1 DataBar), adds a QR Code with a GS1 Digital Link URI or a GS1 DataMatrix with the same GTIN (plus batch/lot, dates and serial when the label carries them as GS1 element strings) and keeps the linear barcode, as the transition period requires both. The symbol is placed in free space found on the rendered label: X-dimension within 0.396–0.990 mm (GS1 General Specifications Table 5-46), quiet zone 4X (QR) or 1X (Data Matrix) plus a clearance, never over other fields or into their quiet zones. The result is verified by rendering the migrated label and by running the "sunrise" compliance pack on it. This is a migration assistant and pre-check. It does not certify the label; check printed labels with a barcode verifier. GS1, GS1 DataMatrix and GS1 Digital Link are trademarks of GS1 AISBL, used here only to name the standards.

Fields & Constants

FieldTypeDescription
const MaxModuleMm = 0.99doubleX-dimension range for 2D symbols at retail POS (GS1 General Specifications 26.0 Table 5-46).
const MinModuleMm = 0.396doubleX-dimension range for 2D symbols at retail POS (GS1 General Specifications 26.0 Table 5-46).

Methods

Method SignatureReturnsDescription
static # Migrate(string zpl, Gs1MigrationOptions? options = default)Gs1MigrationResultAnalyses zpl and adds the 2D carriers (see the class description).
ZplLabelDiff Pixel comparison of one label (A = before, B = after). class13 members#
public sealed class ZplLabelDiff

Pixel comparison of one label (A = before, B = after).

Constructors

SignatureDescription
# ZplLabelDiff()

Properties

PropertyTypeDescription
AddedPixels { get; init; }intInk only in B (drawn green in the overlay).
ChangedPixels { get; }int
Height { get; init; }int
Identical { get; }bool
Index { get; init; }int0-based label index.
MissingInA { get; init; }boolThe label exists only in B (A has fewer labels).
MissingInB { get; init; }boolThe label exists only in A.
OverlayPng { get; init; }byte[]Overlay PNG: white background, grey = unchanged, red = removed, green = added (null when not requested).
Regions { get; init; }IReadOnlyList<ZplDiffRegion>Changed areas, largest first (at most ZplDiffOptions.MaxRegions).
RemovedPixels { get; init; }intInk only in A (drawn red in the overlay).
UnchangedPixels { get; init; }intInk in both (drawn grey in the overlay).
Width { get; init; }int
ZplRescaler Converts raw ZPL between printer resolutions (e.g. a 203 dpi label for a 300 dpi printer): field origins, label size/home/shift… class2 members#
public static class ZplRescaler

Converts raw ZPL between printer resolutions (e.g. a 203 dpi label for a 300 dpi printer): field origins, label size/home/shift, boxes/circles/lines, fonts (^A, ^CF), field blocks, ^BY module width and barcode heights, 2D module sizes (QR, DataMatrix, Aztec, PDF417 row height) and ^GF graphics (resampled, written as :Z64:).

Field data and unknown commands pass through unchanged. Module widths are integers on the printer, so 1D barcodes get the nearest whole module (min 1) — their total width can differ slightly from the exact ratio. Downloaded graphics (~DG/~DY) and binary ^GFB data are not resampled.

Methods

Method SignatureReturnsDescription
static # Rescale(string zpl, double factor)stringScales all dot values by factor.
static # Rescale(string zpl, int fromDpi, int toDpi)stringRescales ZPL from fromDpi to toDpi.

ZplCore.Twin #

24 types

Printer Twin hardware compatibility checker, Zebra printer profiles with citations, and print-time estimation (ZplPrinterTwin, PrinterProfiles).

OptionAvailability Whether a hardware option exists for a model. enum3 members#
public enum OptionAvailability

Whether a hardware option exists for a model.

Values

NameValueDescription
None0The model has no such option (the source says so).
Optional1Available as factory or field option or as a separate SKU (not installed unless configured).
Standard2Part of the standard model.
PrintMethod Print methods a model supports. enum2 members#
public enum PrintMethod

Print methods a model supports.

Values

NameValueDescription
DirectThermal0
ThermalTransfer1
PrinterDetection Result of PrinterProfiles.Detect. record8 members#
public record PrinterDetection

Result of PrinterProfiles.Detect.

Constructors

SignatureDescription
# PrinterDetection(PrinterIdentity Identity, PrinterProfile Profile, ProfileMatch Match, IReadOnlyList<PrinterProfile> Candidates, IReadOnlyList<string> Notes)Result of PrinterProfiles.Detect. Identity: Parsed values. · Profile: Best profile (with the reported firmware applied via PrinterProfile.WithFirmware), null if none. · Match: Match quality. · Candidates: All profiles that fit. · Notes: Why the match is not exact, conflicts …

Properties

PropertyTypeDescription
Candidates { get; init; }IReadOnlyList<PrinterProfile>All profiles that fit.
Identity { get; init; }PrinterIdentityParsed values.
Match { get; init; }ProfileMatchMatch quality.
Notes { get; init; }IReadOnlyList<string>Why the match is not exact, conflicts …
Profile { get; init; }PrinterProfileBest profile (with the reported firmware applied via PrinterProfile.WithFirmware), null if none.

Methods

Method SignatureReturnsDescription
# Deconstruct(out PrinterIdentity Identity, out PrinterProfile Profile, out ProfileMatch Match, out IReadOnlyList<PrinterProfile> Candidates, out IReadOnlyList<string> Notes)void
# ToJson(bool indented = true)string
PrinterIdentity What a printer said about itself (parsed by PrinterProfiles.Detect). record11 members#
public record PrinterIdentity

What a printer said about itself (parsed by PrinterProfiles.Detect).

Constructors

SignatureDescription
# PrinterIdentity()

Properties

PropertyTypeDescription
Dpi { get; init; }int?Resolution in dpi (from ~HI dots/mm 6/8/12/24, head.resolution.in_dpi, or a "-203dpi" model suffix).
Firmware { get; init; }stringFirmware as reported, e.g. "V89.21.46Z".
FirmwareVersion { get; }ZplFirmwareVersion
Languages { get; init; }stringdevice.languages or the ~HQPP / IEEE 1284 command set.
MemoryKb { get; init; }long?~HI memory field in KB.
Model { get; init; }stringModel as reported, e.g. "ZD230" (~HI), "GX420t" (~HQPP), "ZD621" (device.product_name).
Options { get; init; }string~HI option field (meaning of the letters is not documented beyond "cutter, options, et cetera").
PrintWidthDots { get; init; }int?ezpl.print_width in dots.
SerialNumber { get; init; }string
Values { get; init; }IReadOnlyDictionary<string, string>Every key/value found (SGD names, "~HI.model" …).
PrinterOption Hardware options that ZPL commands depend on. enum8 members#
public enum PrinterOption

Hardware options that ZPL commands depend on.

Values [Flags]

NameValueDescription
None0
Cutter0x1Cutter (^MMC, ^MMD, ^MMK, ~JK, ^CN).
Peeler0x2Peeler / dispenser (^MMP).
Rewinder0x4Rewinder or liner take-up (^MMR).
Rfid0x8UHF RFID encoder (^RF, ^RS, ^RB, ^WT, ^HR ...; ^MMF).
Linerless0x10Linerless media (^MML, ^MMU).
Applicator0x20Applicator interface (^MMA).
RealTimeClock0x40Real-time clock (^SL, ^SO, ^ST, ^FC).
PrinterProfile Device and firmware profile of one printer model at one resolution ("printer twin"): print width and length, speed, m… class51 members#
public sealed class PrinterProfile

Device and firmware profile of one printer model at one resolution ("printer twin"): print width and length, speed, memory, options, resident fonts, languages and firmware. Every field is a ProfileFact with a cited source or marked unknown. Built-in profiles: PrinterProfiles.BuiltIn; custom profiles are loaded from JSON with the same schema (PrinterProfiles.Load). Model names identify the hardware the data describes; zplCore is not affiliated with the printer vendor.

Constructors

SignatureDescription
# PrinterProfile()

Properties

PropertyTypeDescription
Aliases { get; init; }IReadOnlyList<string>Other names that PrinterProfiles.Find accepts (e.g. "ZD421-203").
Applicator { get; init; }ProfileFact<OptionAvailability>
BitmapFonts { get; init; }ProfileFact<IReadOnlyList<string>>Resident ZPL bitmap font ids (e.g. A–H, GS, P–V).
Category { get; init; }stringdesktop, industrial, mobile or generic.
Cutter { get; init; }ProfileFact<OptionAvailability>
Description { get; init; }stringFree text, e.g. "203 dpi direct thermal".
DotsPerMm { get; }doubleDots per mm of the printhead, 0 when unknown: 6, 8, 12 or 24 for 152, 203, 300 and 600 dpi (the guide's printheads, "8 dot/mm (203 dpi)", [Z] p.294 / ~HI p.224), else dpi / 25.4.
Dpi { get; init; }ProfileFact<int>Print resolution in dots per inch.
Family { get; init; }stringModel family, e.g. "ZD421".
Firmware { get; init; }ProfileFact<string>Latest firmware version found in the sources, e.g. "V93.21.39Z".
FirmwareOverride { get; }stringThe firmware override set by PrinterProfile.WithFirmware, if any.
FirmwareText { get; }stringThe firmware the checks assume, as written (override or PrinterProfile.Firmware), null when unknown.
FirmwareVersion { get; }ZplFirmwareVersionFirmware the checks assume (PrinterProfile.Firmware unless overridden with PrinterProfile.WithFirmware).
FlashMb { get; init; }ProfileFact<double>Total flash in MB.
FontStatement { get; init; }ProfileFact<string>The resident font statement of the source, summarised (counts, Unicode, TrueType/OpenType, Asian fonts).
HostIdModel { get; init; }ProfileFact<string>Model string that the printer reports in ~HI (first field), when known from a real response.
required Id { get; init; }stringUnique id, e.g. "ZD421d-203".
InstalledOptions { get; init; }PrinterOptionOptions assumed to be installed (default: the options that are OptionAvailability.Standard). Use PrinterProfile.WithOptions to model a printer with e.g. a cutter.
Interfaces { get; init; }ProfileFact<IReadOnlyList<string>>
IsBuiltIn { get; init; }boolTrue for profiles shipped with zplCore.
Languages { get; init; }ProfileFact<IReadOnlyList<string>>Printer languages, e.g. ZPL II, EPL2, CPCL, XML, ZBI, PDF Direct.
Linerless { get; init; }ProfileFact<OptionAvailability>
LinkOs { get; init; }ProfileFact<string>Link-OS version of PrinterProfile.Firmware, e.g. "7.4".
MaxPrintLengthDots { get; }int?Maximum print length in dots, null when unknown.
MaxPrintLengthMm { get; init; }ProfileFact<double>Maximum print length in mm (the largest stated value, e.g. continuous media).
MaxPrintSpeedIps { get; init; }ProfileFact<double>Maximum print speed in inches per second.
MaxPrintWidthDots { get; }int?Printhead width in dots (from PrinterProfile.MaxPrintWidthMm and PrinterProfile.Dpi), null when unknown.
MaxPrintWidthMm { get; init; }ProfileFact<double>Maximum print width (printhead width) in mm.
MinPrintSpeedIps { get; init; }ProfileFact<double>Lowest programmable print speed in inches per second.
required Model { get; init; }stringModel name, e.g. "ZD421d".
Peeler { get; init; }ProfileFact<OptionAvailability>
PrintMethods { get; init; }ProfileFact<IReadOnlyList<PrintMethod>>
RamMb { get; init; }ProfileFact<double>Total RAM (SDRAM/DRAM) in MB.
RealTimeClock { get; init; }ProfileFact<OptionAvailability>
Rewinder { get; init; }ProfileFact<OptionAvailability>
Rfid { get; init; }ProfileFact<OptionAvailability>
ScalableFonts { get; init; }ProfileFact<IReadOnlyList<string>>Resident scalable ZPL font ids (e.g. "0").
Sources { get; init; }IReadOnlyDictionary<string, ProfileSource>Cited sources by id.
TrueTypeFonts { get; init; }ProfileFact<bool>Downloadable TrueType / OpenType fonts are supported.
Unicode { get; init; }ProfileFact<bool>The vendor states Unicode support.
UserFlashMb { get; init; }ProfileFact<double>User-available non-volatile memory (E: drive) in MB.
UserRamMb { get; init; }ProfileFact<double>User-available RAM (R: drive) in MB.
Vendor { get; init; }stringVendor of the hardware described (descriptive only).

Methods

Method SignatureReturnsDescription
# Availability(PrinterOption option)ProfileFact<OptionAvailability>Availability of one option.
# CreateRenderSettings(ZplRenderSettings? baseSettings = default)ZplRenderSettingsRender settings for this printer: dpi, label width = printhead width (^PW can only make it smaller on the printer), ZplRenderSettings.CutterInstalled. Properties of baseSettings (field values, output format ...) are kept.
# Facts()IReadOnlyList<(string, ProfileFactStatus, string, IReadOnlyList<string>, string)>All facts by JSON name, for coverage reports.
# Has(PrinterOption option)boolThe option is installed on the modelled printer.
# ToString()string
# WithFirmware(string firmware)PrinterProfileA copy that the checks treat as running firmware (e.g. "V60.13.0.10" for an old printer).
# WithOptions(PrinterOption options)PrinterProfileA copy with these options installed in addition to the standard ones. Throws ArgumentException when a source explicitly says the model has no such option (verified "none"); options that are only not listed (derived "none") or unknown can be installed.
PrinterProfiles The printer profile catalogue: built-in profiles (embedded JSON, one file per family, schema PrinterProfiles.SchemaJson), custo… class12 members#
public static class PrinterProfiles

The printer profile catalogue: built-in profiles (embedded JSON, one file per family, schema PrinterProfiles.SchemaJson), custom profiles added with PrinterProfiles.Register / PrinterProfiles.Load, lookup by id or alias and detection from printer responses (PrinterProfiles.Detect).

Properties

PropertyTypeDescription
static All { get; }IReadOnlyList<PrinterProfile>Built-in and registered profiles (a registered profile with the id of a built-in one replaces it).
static BuiltIn { get; }IReadOnlyList<PrinterProfile>Profiles shipped with zplCore, in catalogue order.
static Generic { get; }PrinterProfileThe generic profile (zplCore defaults, no hardware limits that are not assumptions).
static SchemaJson { get; }stringJSON schema (draft 2020-12) of a profile family file.

Methods

Method SignatureReturnsDescription
static # Detect(string response)PrinterDetectionParses what a printer answered and picks the matching profile. Accepts (also mixed, one per line): the ~HI answer ("ZD230,V89.21.46Z,8,4096KB," with or without STX/ETX), ~HQPP ("MDL: GX420t"), ~HQSN, an IEEE 1284 device id (usb.device.device_id_string), SGD lines "name : value" (allcv) or a JSON object of SGD names and values (device.product_name, appl.name, head.resolution.in_dpi, device.languages, ezpl.print_width, device.unique_id, device.host_identification, usb.device.product_string).
static # Find(string idOrAlias)PrinterProfileFinds a profile by id or alias (case-insensitive; "ZD421-203", "zd421d-203" and "ZD421d 203" all match); null if none.
static # Get(string idOrAlias)PrinterProfileLike PrinterProfiles.Find but throws KeyNotFoundException with the list of ids.
static # Load(string json)IReadOnlyList<PrinterProfile>Parses a profile family document (see PrinterProfiles.SchemaJson) into one profile per variant. Throws FormatException with all problems found: unknown fields, values of the wrong type, verified or derived values without a source, source ids that the document does not define.
static # LoadDirectory(string directory)IReadOnlyList<PrinterProfile>Loads every *.json profile family file of a directory (not recursive).
static # Register(PrinterProfile profile)voidAdds or replaces a custom profile (process-wide).
static # ToJson(PrinterProfile profile, bool indented = true)stringThe profile as a flat JSON object (facts with status, value, sources, quote, note; sources with URLs).
static # Unregister(string id)boolRemoves a custom profile; built-in profiles cannot be removed.
ProfileFact<T> One field of a PrinterProfile with its provenance: value, status, the ids of the sources in PrinterProfile.Sources and a short … class10 members#
public sealed class ProfileFact<T>

One field of a PrinterProfile with its provenance: value, status, the ids of the sources in PrinterProfile.Sources and a short supporting quote. Unknown facts have no value.

Constructors

SignatureDescription
# ProfileFact()

Properties

PropertyTypeDescription
Exhaustive { get; init; }boolFor lists: false when the source names only part of the items (e.g. "16 bitmap fonts" but only A–H and GS are named). Checks then report items outside the list as "not confirmed" instead of "missing".
IsKnown { get; }boolThe fact has a value (verified, derived or assumed).
Note { get; init; }stringWhy the value is derived / unknown, conflicts between sources etc.
Quote { get; init; }stringShort verbatim snippet from the source (a few words, for review).
Sources { get; init; }IReadOnlyList<string>Ids of PrinterProfile.Sources that back the value.
Status { get; init; }ProfileFactStatus
Value { get; init; }TThe value; default for ProfileFactStatus.Unknown.

Methods

Method SignatureReturnsDescription
# ToString()string
static # Unknown(string? note = default)ProfileFact<T>An unknown fact.
ProfileFactStatus How a ProfileFact value is backed. enum4 members#
public enum ProfileFactStatus

How a ProfileFact value is backed.

Values

NameValueDescription
Verified0The value is stated in a cited source (spec sheet, user guide, release notes).
Derived1Computed or combined from verified facts (e.g. dots from mm and dpi); the note says how.
Assumed2A modelling assumption, not a vendor statement (used by the generic profile and for custom data).
Unknown3No source found. Checks that need the value report that they could not check it.
ProfileMatch How well PrinterDetection.Profile matches. enum4 members#
public enum ProfileMatch

How well PrinterDetection.Profile matches.

Values

NameValueDescription
None0No profile for this model.
Firmware1Only the firmware branch (platform) matched.
Family2Model family matched, variant (e.g. direct thermal vs thermal transfer) or resolution not distinguishable.
Exact3Model and resolution matched.
ProfileSource A cited source of profile data. record7 members#
public record ProfileSource

A cited source of profile data.

Constructors

SignatureDescription
# ProfileSource(string Id, string Url, string Title, string? Accessed = default, string? Note = default)A cited source of profile data. Id: Id used by ProfileFact.Sources. · Url: Where the document was read. · Title: Document title, part number or date. · Accessed: Date the document was read (yyyy-MM-dd). · Note: E.g. "distributor copy of the official sheet".

Properties

PropertyTypeDescription
Accessed { get; init; }stringDate the document was read (yyyy-MM-dd).
Id { get; init; }stringId used by ProfileFact.Sources.
Note { get; init; }stringE.g. "distributor copy of the official sheet".
Title { get; init; }stringDocument title, part number or date.
Url { get; init; }stringWhere the document was read.

Methods

Method SignatureReturnsDescription
# Deconstruct(out string Id, out string Url, out string Title, out string Accessed, out string Note)void
ZplFirmwareVersion Zebra-style firmware version "V93.21.39Z": ZplFirmwareVersion.Platform is the OS branch (93), ZplFirmwareVersion.Feat… record8 members#
public record ZplFirmwareVersion

Zebra-style firmware version "V93.21.39Z": ZplFirmwareVersion.Platform is the OS branch (93), ZplFirmwareVersion.FeatureLevel the "x.21" level that the ZPL programming guide uses for feature gates ("V60.14.x, V50.14.x, or later" means feature level 14), ZplFirmwareVersion.Build the build and ZplFirmwareVersion.Suffix trailing letters.

Constructors

SignatureDescription
# ZplFirmwareVersion(char Prefix, int Platform, int FeatureLevel, int? Build, string Suffix)Zebra-style firmware version "V93.21.39Z": ZplFirmwareVersion.Platform is the OS branch (93), ZplFirmwareVersion.FeatureLevel the "x.21" level that the ZPL programming guide uses for feature gates ("V60.14.x, V50.14.x, or later" means feature level 14), ZplFirmwareVersion.Build the build and ZplFirmwareVersion.Suffix trailing letters.

Properties

PropertyTypeDescription
Build { get; init; }int?
FeatureLevel { get; init; }int
Platform { get; init; }int
Prefix { get; init; }char
Suffix { get; init; }string

Methods

Method SignatureReturnsDescription
# Deconstruct(out char Prefix, out int Platform, out int FeatureLevel, out int? Build, out string Suffix)void
static # TryParse(string text)ZplFirmwareVersionParses "V93.21.39Z", "V61.17.17Z", "R62.15.8Z", "V60.13.0.12ZB", "V93.21" (case-insensitive); null if it does not look like one.
ZplLabelEstimate Estimated time of one printed label. record8 members#
public record ZplLabelEstimate

Estimated time of one printed label.

Constructors

SignatureDescription
# ZplLabelEstimate(int Index, double LengthMm, TimeSpan Start, TimeSpan Duration, bool Cut, bool PauseAfter)Estimated time of one printed label. Index: Label index in print order (^PQ copies included). · LengthMm: Printed length (label plus gap). · Start: Time from the start of the transfer until the label starts printing. · Duration: Print, backfeed and cut time of this label. · Cut: The printer cuts after this label. · PauseAfter: The printer pauses after this label (operator action, not included).

Properties

PropertyTypeDescription
Cut { get; init; }boolThe printer cuts after this label.
Duration { get; init; }TimeSpanPrint, backfeed and cut time of this label.
Index { get; init; }intLabel index in print order (^PQ copies included).
LengthMm { get; init; }doublePrinted length (label plus gap).
PauseAfter { get; init; }boolThe printer pauses after this label (operator action, not included).
Start { get; init; }TimeSpanTime from the start of the transfer until the label starts printing.

Methods

Method SignatureReturnsDescription
# Deconstruct(out int Index, out double LengthMm, out TimeSpan Start, out TimeSpan Duration, out bool Cut, out bool PauseAfter)void
ZplPrintEstimate Print time estimate of ZplPrinterTwin.Estimate. It is a model, not a measurement: ZplPrintEstimate.Assumptions lists every assu… class18 members#
public sealed class ZplPrintEstimate

Print time estimate of ZplPrinterTwin.Estimate. It is a model, not a measurement: ZplPrintEstimate.Assumptions lists every assumption; operator pauses, media calibration and the printer's formatting time are not included unless configured.

Properties

PropertyTypeDescription
Assumptions { get; }IReadOnlyList<string>Every assumption the numbers depend on.
Bytes { get; }longJob size in bytes (UTF-8).
BytesPerSecond { get; }double
Cuts { get; }int
FirstLabel { get; }TimeSpanTime until the first label is out.
LabelCount { get; }int
Labels { get; }IReadOnlyList<ZplLabelEstimate>Per-label times (empty when the job had more labels than ZplPrintEstimateOptions.MaxRenderedLabels).
Pauses { get; }int^PQ pauses (operator presses resume; waiting time not included).
Printing { get; }TimeSpanSum of the label times (print, gap, backfeed, cut).
Profile { get; }PrinterProfile
SpeedIps { get; }doubleEffective print speed of the first label in inches per second (after the model limit).
Total { get; }TimeSpanEstimated time from the start of the transfer until the last label is out.
TotalLengthMm { get; }doubleMedia fed through the printer in mm.
Transfer { get; }TimeSpanTime to send the job over the link (it overlaps with printing).

Methods

Method SignatureReturnsDescription
# ToJson(bool indented = true)string
# ToString()string
# ToText()string
ZplPrintEstimateOptions Assumptions of ZplPrinterTwin.Estimate; every default is listed in ZplPrintEstimate.Assumptions. class11 members#
public sealed class ZplPrintEstimateOptions

Assumptions of ZplPrinterTwin.Estimate; every default is listed in ZplPrintEstimate.Assumptions.

Constructors

SignatureDescription
# ZplPrintEstimateOptions()

Properties

PropertyTypeDescription
BackfeedMm { get; set; }double?Backfeed distance per label in mm (tear-off, peel, cutter); null = not included (the distance is model-specific and not in the profiles).
BytesPerSecond { get; set; }double?Effective link throughput in bytes per second; null = the assumed value of ZplPrintEstimateOptions.Link (see ZplPrintEstimateOptions.AssumedBytesPerSecond).
CutSeconds { get; set; }double?Time per cut in seconds; null = not included (not stated in the profile sources).
DefaultPrintSpeedIps { get; set; }double?Print speed when the job has no ^PR (the printer then uses its stored setting); null = the model's maximum speed.
FieldValues { get; set; }IReadOnlyDictionary<int, string>Field values for ^FN fields.
FormatSeconds { get; set; }doubleTime a label takes to format before printing starts, in seconds (default 0: not included).
GapMm { get; set; }doubleGap or mark between labels in mm, fed at print speed (default 0: not included).
MaxRenderedLabels { get; set; }intLabels the job may produce before the estimate extrapolates per format instead of rendering every copy (default 200).

Methods

Method SignatureReturnsDescription
static # AssumedBytesPerSecond(ZplPrinterLink link)doubleAssumed effective throughput in bytes per second (an assumption, not a measurement; printers are often limited by their own data processing, not by the link): USB 1 MB/s, Ethernet 2 MB/s, Wi-Fi 500 KB/s, Bluetooth 20 KB/s, serial 960 B/s (9600 baud, 10 bits per byte).
ZplPrinterTwin Printer twin: answers "will this label print correctly on this printer model?" with a PrinterProfile. ZplPrinterTwin.… class4 members#
public static class ZplPrinterTwin

Printer twin: answers "will this label print correctly on this printer model?" with a PrinterProfile. ZplPrinterTwin.Check reports clipping against the printhead width (from the rendered field geometry), label length, firmware feature gates, hardware options, resident fonts and encodings, memory for downloaded objects, print speed and darkness. ZplPrinterTwin.Render renders as that printer prints and ZplPrinterTwin.Estimate estimates the print time. The checks are only as good as the profile: facts marked unknown are reported as ZplTwinDiagnosticCodes.UnknownFact hints instead of being guessed. Rules and sources: docs-internal/printer-twin.md. Model names are used to identify the hardware described; zplCore is not affiliated with the printer vendor.

Methods

Method SignatureReturnsDescription
static # Check(string zpl, PrinterProfile profile, ZplTwinOptions? options = default)ZplTwinReportChecks zpl against profile.
static # Estimate(string zpl, PrinterProfile profile, ZplPrintEstimateOptions? options = default)ZplPrintEstimateEstimates how long zpl takes on profile: transfer over the link (pipelined with printing: a format prints once it has arrived), label length (rendered height plus gap) at the ^PR print speed limited to the model maximum ([Z] p.327), cuts and pauses from the cut plan, optional backfeed and cut times.
static # Render(string zpl, PrinterProfile profile, ZplRenderSettings? settings = default, ZplTwinOptions? options = default)ZplTwinRenderRenders zpl as profile prints it: the profile's dpi, label width = printhead width (a wider ^PW is limited to it), output cropped at the printhead edge, cutter as installed. Missing fonts are drawn with zplCore's fallback (font 0 for an unknown letter, font A for a missing ^A@ file, like ZplDiagnosticCodes.FontNotFound); ZplTwinRender.Report says which. The caller disposes the bitmaps.
static # RenderAnnotated(string zpl, PrinterProfile profile, ZplTwinOptions? options = default)List<byte[]>PNG previews with the twin findings drawn in: the area beyond the printhead hatched red, clipped fields framed (red = error, orange = warning) and tagged with their code, and a header line with profile and counts.
ZplTwinClip A field cut off by the printhead width. record11 members#
public record ZplTwinClip

A field cut off by the printhead width.

Constructors

SignatureDescription
# ZplTwinClip(int LabelIndex, string Command, string Content, int X, int Y, int Width, int Height, int ClippedDots, bool Fully)A field cut off by the printhead width. LabelIndex: 0-based label. · Command: Field command, e.g. "BC", "A", "GB". · Content: Field data (shortened). · X: Left edge in dots. · Y: Top edge in dots. · Width: Width in dots. · Height: Height in dots. · ClippedDots: Dots of the field's width beyond the printhead. · Fully: The whole field is outside the printable width.

Properties

PropertyTypeDescription
ClippedDots { get; init; }intDots of the field's width beyond the printhead.
Command { get; init; }stringField command, e.g. "BC", "A", "GB".
Content { get; init; }stringField data (shortened).
Fully { get; init; }boolThe whole field is outside the printable width.
Height { get; init; }intHeight in dots.
LabelIndex { get; init; }int0-based label.
Width { get; init; }intWidth in dots.
X { get; init; }intLeft edge in dots.
Y { get; init; }intTop edge in dots.

Methods

Method SignatureReturnsDescription
# Deconstruct(out int LabelIndex, out string Command, out string Content, out int X, out int Y, out int Width, out int Height, out int ClippedDots, out bool Fully)void
ZplTwinDiagnosticCodes Stable codes of printer twin diagnostics (ZPL5xxx, see DIAGNOSTICS.md and docs-internal/printer-twin.md). class20 members#
public static class ZplTwinDiagnosticCodes

Stable codes of printer twin diagnostics (ZPL5xxx, see DIAGNOSTICS.md and docs-internal/printer-twin.md).

Fields & Constants

FieldTypeDescription
const ClockMissing = "ZPL5205"stringReal-time clock commands (^FC, ^KD, ^SL, ^SO, ^ST) on a model without (or with unknown) real-time clock.
const DarknessOutOfRange = "ZPL5502"string~SD or ^MD darkness outside the documented range.
const DpiHint = "ZPL5105"stringHeuristic: ^PW/^LL are whole label sizes at another resolution, not at this printer's.
const DpiMismatch = "ZPL5104"stringThe label was designed for another resolution (ZplTwinOptions.DesignDpi): it prints scaled.
const EncodingUnsupported = "ZPL5303"stringUnicode or TrueType use on a model whose profile says it is not supported (or unknown).
const FieldClipped = "ZPL5102"stringA field lies partly or completely outside the printhead width and is clipped.
const FirmwareTooOld = "ZPL5201"stringThe command or parameter needs a newer firmware feature level than the profile's firmware.
const FontFileNotResident = "ZPL5302"string^A@ / ^CW / ^FL refers to a font file that is neither downloaded in the job nor known to be resident.
const FontNotResident = "ZPL5301"stringThe font is not in the profile's resident font list (or the list is not exhaustive / unknown).
const GlyphCoverage = "ZPL5304"stringText with characters outside the code page of a bitmap font, or whose glyph coverage in font 0 is not documented.
const LanguageUnsupported = "ZPL5203"stringThe profile lists printer languages without ZPL.
const LengthExceedsMaximum = "ZPL5103"string^LL or the content is longer than the maximum print length.
const MemoryBudget = "ZPL5402"stringMemory budget summary per drive (downloads in the job).
const MemoryOverflow = "ZPL5401"stringDownloaded graphics, fonts and formats exceed the user memory of a drive.
const OptionMissing = "ZPL5202"stringThe command needs a hardware option (peeler, rewinder, applicator, RFID, linerless) that is not installed or not available.
const PrepeelIgnored = "ZPL5206"string^MM prepeel parameter on a Link-OS printer ("not supported by Link-OS printers").
const PrintMethodUnsupported = "ZPL5204"string^MTT (thermal transfer) on a direct-thermal-only model.
const SpeedOutOfRange = "ZPL5501"string^PR speed above the model's maximum (the printer runs at its maximum) or below its minimum.
const UnknownFact = "ZPL5001"stringA profile fact needed by a check is unknown; the check was skipped or is only a hint.
const WidthExceedsPrinthead = "ZPL5101"string^PW is wider than the printhead; the printer uses the printhead width.
ZplTwinDownload Downloaded object stored on a printer drive. record6 members#
public record ZplTwinDownload

Downloaded object stored on a printer drive.

Constructors

SignatureDescription
# ZplTwinDownload(string Drive, string Name, string Command, long Bytes)Downloaded object stored on a printer drive. Drive: R:, E:, B:, A: … · Name: Object name with extension. · Command: ~DG, ~DY, ~DU, ~DT, ~DB, ~DE, ^DF, ^IS. · Bytes: Size in bytes (declared size parameter, or the data length).

Properties

PropertyTypeDescription
Bytes { get; init; }longSize in bytes (declared size parameter, or the data length).
Command { get; init; }string~DG, ~DY, ~DU, ~DT, ~DB, ~DE, ^DF, ^IS.
Drive { get; init; }stringR:, E:, B:, A: …
Name { get; init; }stringObject name with extension.

Methods

Method SignatureReturnsDescription
# Deconstruct(out string Drive, out string Name, out string Command, out long Bytes)void
ZplTwinMemoryUse Use of one drive by the downloads of the job. record6 members#
public record ZplTwinMemoryUse

Use of one drive by the downloads of the job.

Constructors

SignatureDescription
# ZplTwinMemoryUse(string Drive, long UsedBytes, long? CapacityBytes)Use of one drive by the downloads of the job. Drive: R:, E:, B:, A:. · UsedBytes: Sum of the downloads (an object downloaded twice counts once). · CapacityBytes: User-available memory from the profile; null when unknown.

Properties

PropertyTypeDescription
CapacityBytes { get; init; }long?User-available memory from the profile; null when unknown.
Drive { get; init; }stringR:, E:, B:, A:.
Ratio { get; }double?Used share of the capacity (0–1+), null when the capacity is unknown.
UsedBytes { get; init; }longSum of the downloads (an object downloaded twice counts once).

Methods

Method SignatureReturnsDescription
# Deconstruct(out string Drive, out long UsedBytes, out long? CapacityBytes)void
ZplTwinOptions Options of ZplPrinterTwin.Check. class6 members#
public sealed class ZplTwinOptions

Options of ZplPrinterTwin.Check.

Constructors

SignatureDescription
# ZplTwinOptions()

Properties

PropertyTypeDescription
DefaultLabelLengthMm { get; set; }doubleDefault label length in mm when the job has no ^LL (default 152.4 = 6 in., the zplCore default).
DesignDpi { get; set; }int?Resolution the label was designed for; a different profile dpi reports ZplTwinDiagnosticCodes.DpiMismatch.
FieldValues { get; set; }IReadOnlyDictionary<int, string>Values for ^FN fields (as ZplRenderSettings.FieldValues).
IncludeInfo { get; set; }boolAlso report Info findings (default true).
StoredObjects { get; }ICollection<string>Fonts or objects already stored on the printer (e.g. "E:ARIAL.TTF"), not reported as missing.
ZplTwinRender Result of ZplPrinterTwin.Render: the labels as the printer prints them and the twin report. class4 members#
public sealed class ZplTwinRender : IDisposable

Result of ZplPrinterTwin.Render: the labels as the printer prints them and the twin report.

Constructors

SignatureDescription
# ZplTwinRender(List<ZplRenderResult> results, ZplTwinReport report)Result of ZplPrinterTwin.Render: the labels as the printer prints them and the twin report.

Properties

PropertyTypeDescription
Report { get; }ZplTwinReportFindings of ZplPrinterTwin.Check, including font substitutions.
Results { get; }List<ZplRenderResult>Rendered labels, cropped at the printhead width.

Methods

Method SignatureReturnsDescription
# Dispose()void
ZplTwinReport Result of ZplPrinterTwin.Check. class14 members#
public sealed class ZplTwinReport

Result of ZplPrinterTwin.Check.

Properties

PropertyTypeDescription
Clips { get; }IReadOnlyList<ZplTwinClip>Fields cut off by the printhead width.
Diagnostics { get; }IReadOnlyList<ZplDiagnostic>Findings, ordered by source position (ZPL5xxx and the cutter codes ZPL41xx).
Downloads { get; }IReadOnlyList<ZplTwinDownload>Objects the job stores on printer drives.
IsClean { get; }boolNo warnings or errors (info findings allowed).
LabelCount { get; }intNumber of rendered labels (one per format, ^PQ copies not counted).
LabelLengthDots { get; }intLength of the first label in dots (^LL or the default media length).
LabelWidthDots { get; }intWidth of the first label in dots as the printer prints it (printhead width or a smaller ^PW).
MaxSeverity { get; }ZplDiagnosticSeverity?Highest severity, null without findings.
Memory { get; }IReadOnlyList<ZplTwinMemoryUse>Memory use per drive.
Profile { get; }PrinterProfileThe profile checked against (with options and firmware override).

Methods

Method SignatureReturnsDescription
# Fails(ZplDiagnosticSeverity severity)boolTrue when a finding has at least severity.
# ToJson(bool indented = true)stringThe report as JSON: profile id, diagnostics, clips, downloads, memory.
# ToString()string
# ToText(string? fileName = default)stringHuman-readable report.

ZplCore.VectorLift #

8 types

PDF and SVG to native ZPL conversion engine (VectorLift, VectorLiftOptions, VectorLiftResult, LiftedElement).

LiftFontMode How text is reproduced in ZPL. enum2 members#
public enum LiftFontMode

How text is reproduced in ZPL.

Values

NameValueDescription
Font00Scalable printer font 0 (^A0) with height and width fitted to the original run (default, no download).
EmbedTrueType1Download the caller's TrueType/OpenType font with ~DU and print with ^A@ – for text whose font name matches a key of VectorLiftOptions.Fonts and whose OS/2 fsType permits embedding (installable, preview & print, editable); restricted or bitmap-only fonts are refused with a warning. Other text uses font 0. Fonts embedded in the PDF are never extracted (usually subsets with unknown licence terms).
LiftOutcome What happened to a source element. enum4 members#
public enum LiftOutcome

What happened to a source element.

Values

NameValueDescription
Native0Reproduced exactly with a native command (^GB, ^GC, ^B…).
Approximated1Native command with approximation (e.g. text in font 0 instead of the original font).
Raster2Reproduced as ^GF graphic of its region.
Dropped3Not reproduced, see LiftedElement.Reason (e.g. white background without effect).
LiftScale Where the page content goes when the label size differs from the page (or crop) size. enum2 members#
public enum LiftScale

Where the page content goes when the label size differs from the page (or crop) size.

Values

NameValueDescription
Fit0Scale uniformly so the content fits the label, centred (default when a size is given).
None11:1 at the top-left corner; content outside the label is cut off.
LiftedElement Report entry for one element of the original. record10 members#
public record LiftedElement

Report entry for one element of the original.

Constructors

SignatureDescription
# LiftedElement()

Properties

PropertyTypeDescription
required Bounds { get; init; }(int, int, int, int)Bounds in dots (x, y, width, height).
DataMatch { get; init; }bool?Barcode: the regenerated barcode decodes to exactly the original data.
Detail { get; init; }stringBarcode symbology (ZXing name, e.g. CODE_128) or font name of the original.
required Kind { get; init; }LiftedKind
required Outcome { get; init; }LiftOutcome
Reason { get; init; }stringWhy the element is approximated, rasterized or dropped.
Score { get; init; }double?Pixel agreement of the element alone (0–1), when measured.
Text { get; init; }stringText content or decoded barcode data.
Zpl { get; init; }stringThe generated command(s) for native elements.
LiftedKind Kind of a source element. enum10 members#
public enum LiftedKind

Kind of a source element.

Values

NameValueDescription
Text0
Box1
Line2
Diagonal3
Circle4
Ellipse5
Barcode6
Image7
Shape8Vector art that is no line, box, circle or ellipse.
Other9Shading, transparency group or other construct.
VectorLift Vector-Lift: converts PDF and SVG labels into native ZPL – text as ^A0 fields, barcodes as native ^B commands (decoded, regener… class5 members#
public static class VectorLift

Vector-Lift: converts PDF and SVG labels into native ZPL – text as ^A0 fields, barcodes as native ^B commands (decoded, regenerated and verified), lines/boxes/circles as ^GB/^GC/^GE/^GD – and ^GF only for regions that have no native equivalent. Every result carries a fidelity measurement against the original rendered at the label resolution and a per-element report.

Methods

Method SignatureReturnsDescription
static # Convert(byte[] data, VectorLiftOptions? options = default)VectorLiftResultConverts a PDF (page VectorLiftOptions.Page) or, when the data is SVG text, an SVG.
static # ConvertPdf(byte[] pdf, VectorLiftOptions? options = default)VectorLiftResultConverts one page of a PDF (VectorLiftOptions.Page, 1-based).
static # ConvertPdfPages(byte[] pdf, VectorLiftOptions? options = default)IReadOnlyList<VectorLiftResult>Converts every page of a PDF (options apply to each page; VectorLiftOptions.Page is ignored).
static # ConvertSvg(string svg, VectorLiftOptions? options = default)VectorLiftResultConverts an SVG document.
static # PdfPageCount(byte[] pdf)intNumber of pages of a PDF.
VectorLiftOptions Options for VectorLift. class19 members#
public sealed class VectorLiftOptions

Options for VectorLift.

Constructors

SignatureDescription
# VectorLiftOptions()

Properties

PropertyTypeDescription
CompareTolerance { get; set; }intPixel tolerance of the fidelity comparison (see ImageCompare).
CropMarginMm { get; set; }doubleMargin around the content when VectorLiftOptions.CropToContent is set.
CropToContent { get; set; }boolCrop the page to its printed content (plus VectorLiftOptions.CropMarginMm), e.g. a label on an A4 sheet.
Dpi { get; set; }int?Printer resolution in dots per inch; null = detect (embedded image resolution, barcode module grid) or 203.
FontMode { get; set; }LiftFontModeText reproduction (font 0 or downloaded TrueType fonts).
Fonts { get; }IDictionary<string, byte[]>TrueType fonts for LiftFontMode.EmbedTrueType, keyed by PDF/SVG font name or family (case-insensitive, e.g. "Arial", "Helvetica-Bold"). Only fonts whose licence allows embedding are downloaded.
GraphicCompression { get; set; }GraphicCompressionCompression of ^GF graphics (fallback regions and the raster comparison).
HeightMm { get; set; }double?Label height in mm; null = page (or crop) height.
ImageDither { get; set; }DitherModeDithering for photo-like images that fall back to ^GF (line art is always thresholded).
IncludeImages { get; set; }boolInclude PNGs of the original, the lifted render and the diff in the result.
LiftBarcodes { get; set; }boolDetect, decode and regenerate barcodes as native ^B commands (otherwise as graphic).
LiftShapes { get; set; }boolReproduce lines, boxes, circles and ellipses as ^GB/^GC/^GE/^GD (otherwise as graphic).
LiftText { get; set; }boolReproduce text as ZPL text fields (otherwise as graphic).
MeasureFidelity { get; set; }boolRender the result and compare it with the original (fills the fidelity values).
MinShapeScore { get; set; }doubleMinimum per-element score (0–1) for a native shape; below it the shape becomes graphic.
Page { get; set; }intPDF page (1-based).
Scale { get; set; }LiftScaleScaling when VectorLiftOptions.WidthMm/VectorLiftOptions.HeightMm differ from the page size.
WidthMm { get; set; }double?Label width in mm; null = page (or crop) width.
VectorLiftResult Result of a Vector-Lift conversion of one page. class24 members#
public sealed class VectorLiftResult

Result of a Vector-Lift conversion of one page.

Constructors

SignatureDescription
# VectorLiftResult()

Properties

PropertyTypeDescription
BarcodesMatch { get; }boolAll barcodes regenerated natively decode to the original data (true when there are none).
Comparison { get; init; }ImageComparison
DiffPng { get; init; }byte[]Diff overlay (black = both, red = only original, blue = only lifted).
required Dpi { get; init; }int
required DpiSource { get; init; }stringHow VectorLiftResult.Dpi was chosen ("option", "image resolution", "barcode modules", "default").
required Elements { get; init; }IReadOnlyList<LiftedElement>
Fidelity { get; }double?Overall pixel fidelity (0–1, F-score of ink within VectorLiftOptions.CompareTolerance) – null when not measured.
FidelityExact { get; init; }double?Fidelity at 0 px tolerance.
required HeightDots { get; init; }int
required NativeInkShare { get; init; }doubleShare of the original ink reproduced with native commands (0–1).
OriginalPng { get; init; }byte[]PNG of the original rasterized at the label resolution (with VectorLiftOptions.IncludeImages).
Page { get; init; }intPage (1-based) for PDF input.
required RasterZplBytes { get; init; }intSize of the same label as one full-page ^GF raster (same compression) in bytes.
RenderedPng { get; init; }byte[]PNG of the lifted ZPL rendered with zplCore.
SharpnessNote { get; }stringPrint-quality note: how much of the label the printer generates itself (sharp at any resolution, rescalable with ZplRescaler) and how much is a fixed graphic at VectorLiftResult.Dpi.
required Warnings { get; init; }IReadOnlyList<string>
required WidthDots { get; init; }int
required Zpl { get; init; }stringThe label as ZPL (^XA…^XZ).
ZplBytes { get; }intSize of VectorLiftResult.Zpl in bytes (UTF-8).

Methods

Method SignatureReturnsDescription
# Count(LiftOutcome outcome)intCount of elements per outcome.
# ToJson(bool indented = true)stringMachine-readable report (no images).
# ToLabel(ImportOptions? options = default)LabelImportResultThe ZPL as editable label model (via Label.FromZpl).
# ToReport()stringHuman-readable report (one line per element).