ZplCore #
30 typesCore 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…
public sealed class EplRendererVirtual 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).
ZplRenderer); use one instance per thread.Constructors
| Signature | Description |
|---|---|
# EplRenderer(ZplRenderSettings? settings = default) |
Properties
| Property | Type | Description |
|---|---|---|
Clock { get; set; } | Func<DateTime> | Time used for TT/TD fields. |
Settings { get; } | ZplRenderSettings | |
Store { get; } | ZplResourceStore | Printer memory shared with the underlying ZPL renderer. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# AddGraphic(string name, byte[] pcx) | void | Stores 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) | string | Translates EPL2 to ZPL II (one ^XA…^XZ per printed label). |
Events
| Event | Handler Type | Description |
|---|---|---|
PrinterControl | EventHandler<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.
public sealed class ScanProofOptionsSettings for ZplScanProof.
Constructors
| Signature | Description |
|---|---|
# ScanProofOptions() |
Properties
| Property | Type | Description |
|---|---|---|
AntiAlias { get; set; } | bool | Render 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; } | int | Printer 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; } | int | Maximum 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; } | bool | Also 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; } | int | Resolution of the downscale step of the robustness simulation (default 203; skipped when not below ScanProofOptions.Dpi). |
UseZxingCpp { get; set; } | bool | Use zxing-cpp (native) when it is available on this platform. Default true. |
UseZxingNet { get; set; } | bool | Use ZXing.Net (managed). Default true. |
ZplCaches
Process-wide caches of the rendering engine (glyph masks, per-typeface metrics, HarfBuzz shapers, compiled property getters). A…
public static class ZplCachesProcess-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
| Property | Type | Description |
|---|---|---|
static GlyphCount { get; } | int | Number of glyphs currently cached (approximate). |
static MaxGlyphs { get; set; } | int | Maximum 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 Signature | Returns | Description |
|---|---|---|
static # Clear() | void | Empties all engine caches. Safe to call while other threads render. |
ZplCutDiagnosticCodes
Stable codes of ZplCutPlan.Diagnostics (see DIAGNOSTICS.md).
public static class ZplCutDiagnosticCodesStable codes of ZplCutPlan.Diagnostics (see DIAGNOSTICS.md).
Fields & Constants
| Field | Type | Description |
|---|---|---|
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" | string | Cutter, 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…
public sealed class ZplCutPlanWhere 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
| Property | Type | Description |
|---|---|---|
CutAfter { get; } | IReadOnlyList<int> | Indexes of the labels after which the printer cuts. |
CutCount { get; } | int | Number of cuts. |
CutsPreviousJob { get; } | bool | A ~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; } | ZplCutPlan | An empty plan (no labels). |
Labels { get; } | IReadOnlyList<ZplLabelCut> | One entry per printed label, in print order. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
static # Analyze(string zpl, ZplRenderSettings? settings = default) | ZplCutPlan | Renders 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) | string | The 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.
public enum ZplCutReasonWhy a label is (or is not) cut, see ZplLabelCut.
Values
| Name | Value | Description |
|---|---|---|
NoCutMode | 0 | The print mode has no cut (tear-off, peel-off, rewind, applicator, RFID, linerless). |
EveryLabel | 1 | ^MMC with ^PQ p = 0: every label is cut. |
PauseAndCutCount | 2 | ^MMC with ^PQ p > 0: cut after each group of p labels ("pause and cut value"). |
EndOfBatch | 3 | ^MMC with ^PQ p > 0: the last label of the batch (q not a multiple of p) is cut too. |
InsideGroup | 4 | ^MMC with ^PQ p > 0: label inside a group, the media is not cut here. |
SuppressedByXB | 5 | ^XB in cutter / delayed cut mode: "^XB suppresses backfeed and cutting". |
AwaitingDelayedCut | 6 | ^MMD: the label waits for ~JK (sent in a separate job). |
DelayedCut | 7 | ^MMD: cut by ~JK. |
KioskPresented | 8 | ^MMK: the label is presented and not cut (no ^CN in the format). |
KioskCutNow | 9 | ^MMK with ^CN: cut now (full cut, or partial cut by the ^KV kiosk cut amount). |
NoCutterInstalled | 10 | Cutter mode, but the printer has no cutter (ZplRenderSettings.CutterInstalled false). |
RfidVoid | 11 | Voided 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…
public record ZplDiagnosticStructured 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
| Signature | Description |
|---|---|
# 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
| Property | Type | Description |
|---|---|---|
Code { get; init; } | string | Stable identifier such as "ZPL1001". |
Column { get; init; } | int | 1-based source column (0 when unknown). |
Command { get; init; } | string | Command the message refers to, e.g. "^GF" (empty when unknown). |
Line { get; init; } | int | 1-based source line (0 when unknown). |
Message { get; init; } | string | Human-readable description (identical to the matching entry of ZplRenderResult.Warnings). |
Offset { get; init; } | int | Character offset of that command in the ZPL source (-1 when unknown). |
Severity { get; init; } | ZplDiagnosticSeverity | How serious the problem is. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# 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).
public static class ZplDiagnosticCodesStable diagnostic codes (documented in DIAGNOSTICS.md).
Fields & Constants
| Field | Type | Description |
|---|---|---|
const BarcodeDataTooLong = "ZPL1003" | string | Barcode field data longer than any symbology can hold; the field was skipped. |
const CommandIgnored = "ZPL2001" | string | Command accepted but without effect on the rendered image (^FE, ^FA, RFID read operations ...). |
const FieldFailed = "ZPL1002" | string | A 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" | string | A key of ZplRenderSettings.FieldValues matches no ^FN field of the rendered labels (INVALID_FIELD_VALUE_KEY); the value was not used. |
const MalformedCommand = "ZPL1001" | string | A command could not be executed (malformed parameters); it was ignored. |
ZplDiagnosticSeverity
Severity of a ZplDiagnostic.
ZplExport
Image/PDF/GRF encoders.
public static class ZplExportImage/PDF/GRF encoders.
Methods
| Method Signature | Returns | Description |
|---|---|---|
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) | string | The 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.
ZplLabelCut
Cut decision for one printed label (index in print order, ^PQ copies included).
public record ZplLabelCutCut decision for one printed label (index in print order, ^PQ copies included).
Constructors
| Signature | Description |
|---|---|
# 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
| Property | Type | Description |
|---|---|---|
Copy { get; init; } | int | 0-based copy within the format's ^PQ quantity. |
Cut { get; init; } | bool | The printer cuts after this label. |
Index { get; init; } | int | 0-based label index in the output of the render call. |
Mode { get; init; } | ZplPrintMode | Print mode in effect for the label. |
PartialCutMm { get; init; } | int | Kiosk 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; } | ZplCutReason | Why it is cut or not. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# Deconstruct(out int Index, out int Copy, out ZplPrintMode Mode, out bool Cut, out ZplCutReason Reason, out bool PauseAfter, out int PartialCutMm) | void |
ZplLabelRenderedEventArgs
public sealed class ZplLabelRenderedEventArgs : EventArgsConstructors
| Signature | Description |
|---|---|
# ZplLabelRenderedEventArgs(int index, byte[] data, IReadOnlyList<ZplRenderedElement> elements) |
Properties
| Property | Type | Description |
|---|---|---|
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…
public record ZplLimitsHard 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.
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
| Signature | Description |
|---|---|
# ZplLimits() |
Properties
| Property | Type | Description |
|---|---|---|
static Current { get; } | ZplLimits | The 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; } | bool | True: 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; } | int | Longest field data (ZplRenderSettings.MaxFieldDataLength). |
MaxGraphicBytes { get; init; } | int | Largest decoded graphic (ZplRenderSettings.MaxGraphicBytes). |
MaxLabelDots { get; init; } | long | Dots per label (ZplRenderSettings.MaxLabelDots). |
MaxLabelSide { get; init; } | int | Longest label side (ZplRenderSettings.MaxLabelSide). |
MaxLabels { get; init; } | int | Labels per render call (ZplRenderSettings.MaxLabels). |
MaxQuantity { get; init; } | int | ^PQ copies (ZplRenderSettings.MaxQuantity). |
MaxStoreBytes { get; init; } | long | Printer storage per store (ZplResourceStore.MaxTotalBytes; 0 there means unlimited and is clamped too). |
Methods
ZplOptimization
Level of ZplOptimizer.
public enum ZplOptimizationLevel of ZplOptimizer.
Values
| Name | Value | Description |
|---|---|---|
None | 0 | ZPL is left as generated. |
Safe | 1 | Removes 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. |
Aggressive | 2 | ZplOptimization.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, ^…
public static class ZplOptimizerShrinks 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 Signature | Returns | Description |
|---|---|---|
static # Optimize(string zpl, ZplOptimization level, GraphicCompression? graphicCompression = default) | string | Optimises zpl at level. zpl: ZPL source. · level: Optimisation level. · graphicCompression: Aggressive only: encoding for ^GFA data (null = shortest of all). |
ZplOutputFormat
public enum ZplOutputFormatValues
| Name | Value | Description |
|---|---|---|
Png | 0 | |
Jpeg | 1 | |
Webp | 2 | |
Bmp | 3 | |
Pdf | 4 | |
Grf | 5 | ZPL with the rendered label as one ^GFA graphic (e.g. for printers lacking fonts). |
Tiff | 6 | Multi-page 1-bit TIFF (all labels in one file). |
Pcx | 7 | 1-bit PCX per label. |
Pcl | 8 | PCL 5 raster per label (laser printers). |
Epl | 9 | EPL2 with the label as GW graphic (Eltron/Zebra EPL printers). |
Fingerprint | 10 | Intermec Fingerprint/DirectProtocol raster. |
EscPos | 11 | ESC/POS raster (receipt printers), incl. cut. |
Gif | 12 | GIF per label. |
Svg | 13 | SVG per label: true vector output by default (see ZplRenderSettings.SvgMode). |
Html | 14 | One HTML page with all labels (see ZplRenderSettings.HtmlImageFormat). |
Eps | 15 | Encapsulated PostScript per label (see ZplRenderSettings.EpsTextAsOutlines). |
ZplPaperOrientation
Orientation of output pages.
ZplPrintMode
Print mode set with ^MMa (ZPL II Programming Guide, ^MM). The value is the ^MM letter. The mode persists across formats until i…
public enum ZplPrintModePrint 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
| Name | Value | Description |
|---|---|---|
TearOff | 84 | ^MMT tear-off (factory default). |
PeelOff | 80 | ^MMP peel-off. |
Rewind | 82 | ^MMR rewind. |
Applicator | 65 | ^MMA applicator. |
Cutter | 67 | ^MMC cutter: "after printing, the media feeds forward and is automatically cut". |
DelayedCut | 68 | ^MMD delayed cutter: the waiting label is cut when the printer receives ~JK. |
Rfid | 70 | ^MMF RFID (no backfeed between RFID labels). |
LinerlessPeel | 76 | ^MML (reserved in ^MM; "Linerless Peel" in SGD media.printmode). |
LinerlessRewind | 85 | ^MMU (reserved in ^MM; "Linerless Rewind" in SGD media.printmode). |
Kiosk | 75 | ^MMK kiosk: the media is presented; ^CN cuts it. |
ZplPrinterControlEventArgs
public sealed class ZplPrinterControlEventArgs : EventArgsConstructors
| Signature | Description |
|---|---|
# ZplPrinterControlEventArgs(ZplCommand command) |
Properties
| Property | Type | Description |
|---|---|---|
Command { get; } | ZplCommand | |
Response { get; set; } | string | Data to send back to the host (e.g. for ~HS); prefilled for ~HS. |
ZplRenderResult
One rendered label.
public sealed class ZplRenderResultOne rendered label.
Constructors
| Signature | Description |
|---|---|
# ZplRenderResult() |
Properties
| Property | Type | Description |
|---|---|---|
required Bitmap { get; init; } | SKBitmap | |
Cut { get; } | ZplLabelCut | Cut 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 Signature | Returns | Description |
|---|---|---|
# RenderedElementsAsJson(bool indented = false) | string | ZplRenderResult.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.
public sealed class ZplRenderSettingsSettings for rendering ZPL to images. All sizes in printer dots unless noted.
Constructors
| Signature | Description |
|---|---|
# ZplRenderSettings() |
Properties
| Property | Type | Description |
|---|---|---|
AntiAlias { get; set; } | bool | Anti-aliased text and shapes. Off gives pure 1-bit output like a thermal printer. |
BackgroundColor { get; set; } | SKColor | Label (paper) color. |
BackgroundImage { get; set; } | SKBitmap | Optional 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; } | bool | Write 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; } | SKColor | Colour of the cut line and scissors (default red #D32F2F). |
CutMarks { get; set; } | bool | Draws 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; } | bool | The 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; } | bool | The 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; } | int | Code 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; } | int | Print resolution: 152, 203, 300 or 600 dpi. |
DrawRfid { get; set; } | bool | Draw the data of ^RF (RFID) fields as a small box on the label. |
EpsTextAsOutlines { get; set; } | bool | EPS 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; } | bool | Fingerprint output without the trailing print statement (PF), e.g. to merge into own programs. |
Flip { get; set; } | ZplFlip | Mirror 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; } | DitherMode | 1-bit conversion for ZplOutputFormat.Grf output. |
HtmlImageFormat { get; set; } | HtmlLabelImageFormat | Image embedded in ZplOutputFormat.Html output. |
ImageScaleX { get; set; } | double | Horizontal scale factor of encoded images (1 = printer dots). DPI metadata is scaled accordingly. |
ImageScaleY { get; set; } | double | Vertical scale factor of encoded images. |
InkColor { get; set; } | SKColor | Ink / ribbon color. |
InvertColors { get; set; } | bool | Swap ink and background (negative output). |
LabelGap { get; set; } | int | |
LabelHeight { get; set; } | int | Label height in dots (default 6 in). ^LL overrides unless ZplRenderSettings.ForceLabelHeight. |
LabelLengthContinuousOnly { get; set; } | bool | Apply ^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; } | int | Label width in dots (default 4 in). ^PW overrides unless ZplRenderSettings.ForceLabelWidth. |
MaxFieldDataLength { get; set; } | int | Maximum length of one field's data (^FD/^FV, after ^FH); longer data is truncated (default 1 M chars). 0 = unlimited. |
MaxGraphicBytes { get; set; } | int | Maximum 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; } | long | Maximum 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; } | int | Maximum width or height of a label in dots (default 32000, the ZPL maximum for ^PW/^LL). 0 = unlimited. |
MaxLabels { get; set; } | int | Maximum number of labels produced by one Render/ProcessCommands call (default 100000); further formats are skipped. |
MaxQuantity { get; set; } | int | Upper 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; } | ZplPaperOrientation | Page orientation of the output (applied to the final image / PDF sheet). |
PaperWidth { get; set; } | int | PDF 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; } | PclColorMode | PCL raster mode. |
PclCompression { get; set; } | PclCompression | PCL raster compression (mode 0, 2 or 3). |
PdfAuthor { get; set; } | string | |
PdfCreator { get; set; } | string | |
PdfKeywords { get; set; } | string | |
PdfProducer { get; set; } | string | PDF Producer metadata. |
PdfSubject { get; set; } | string | |
PdfTitle { get; set; } | string | |
PdfVector { get; set; } | bool | ZplOutputFormat.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; } | PngCompression | PNG zlib level (speed vs. size). |
Quality { get; set; } | int | JPEG/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; } | ZplRfidIndicator | Marks 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; } | SKColor | Colour of the RFID watermark (default light grey #C0C0C0). |
RfidIndicatorOpacity { get; set; } | float | Opacity of the RFID watermark, 0..1 (default 1). |
SvgElementAttributes { get; set; } | bool | Vector SVG: each field group carries data-cmd, data-offset and data-length (source span in the ZPL) for hit testing. |
SvgMode { get; set; } | ZplSvgMode | How 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; } | bool | Vector 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; } | int | When > 0, encoded images are scaled down so the longer edge has this many pixels. |
TiffCompression { get; set; } | TiffCompression | TIFF compression for ZplOutputFormat.Tiff. |
TiffPixelFormat { get; set; } | TiffPixelFormat | TIFF sample format (CCITT compression requires 1 bit). |
TraceElements { get; set; } | bool | Collect ZplRenderedElement information while rendering. |
TransparentBackground { get; set; } | bool | Paper becomes transparent in PNG/WebP/GIF/TIFF output (black/white labels keep anti-aliasing as alpha). |
UseSystemFonts { get; set; } | bool | Also 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; } | SKBitmap | Image drawn over every label (e.g. "MUSTER"/"PREVIEW"), centered and scaled to fit. |
WatermarkOpacity { get; set; } | float | Watermark opacity 0–1. |
WriteDpiMetadata { get; set; } | bool | Write the resolution into PNG (pHYs) and JPEG (JFIF density) files (off by default so existing output stays byte-identical). |
Fields & Constants
| Field | Type | Description |
|---|---|---|
const MaxImageBytes = 52428800 | int | Largest encoded image accepted by the LoadImage* helpers (default 50 MB). |
const MaxImageSide = 20000 | int | Largest width/height in pixels accepted by the LoadImage* helpers. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
static # FromJson(string json) | ZplRenderSettings | |
static # LoadImage(string source) | SKBitmap | Loads 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) | SKBitmap | Decodes a base64 encoded image. |
static # LoadImageFromFile(string path) | SKBitmap | Loads 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() | string | Saves all settings (images as base64 PNG, colors as #AARRGGBB). |
# WithBackgroundImage(string source) | ZplRenderSettings | Sets ZplRenderSettings.BackgroundImage from a file, data URI or base64 string (see ZplRenderSettings.LoadImage). |
# WithLabelSizeInches(double width, double height) | ZplRenderSettings | Convenience: sets label size from inches. |
# WithLabelSizeMm(double widthMm, double heightMm) | ZplRenderSettings | Convenience: sets label size from millimeters. |
# WithWatermarkImage(string source, float opacity = 0.25) | ZplRenderSettings | Sets ZplRenderSettings.WatermarkImage from a file, data URI or base64 string (see ZplRenderSettings.LoadImage). |
ZplRenderedElement
Information about one rendered field (for hit-testing, editors, tests).
public record ZplRenderedElementInformation about one rendered field (for hit-testing, editors, tests).
Constructors
| Signature | Description |
|---|---|
# 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
| Property | Type | Description |
|---|---|---|
Command { get; init; } | string | |
Content { get; init; } | string | |
Height { get; init; } | int | |
Orientation { get; init; } | char | |
Reverse { get; init; } | bool | |
SourceLength { get; init; } | int | Length of the field's source block up to and including ^FS (0 when unknown). |
SourceOffset { get; init; } | int | Character 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 Signature | Returns | Description |
|---|---|---|
# 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) …
public sealed class ZplRendererVirtual 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.
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
| Signature | Description |
|---|---|
# ZplRenderer(ZplRenderSettings? settings = default) |
Properties
| Property | Type | Description |
|---|---|---|
LastCutPlan { get; } | ZplCutPlan | Cut 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; } | ZplPrintMode | Print 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; } | ZplPrintMode | Print mode saved with ^JUS (restored by ~JR / ZplRenderer.Reset). |
Settings { get; } | ZplRenderSettings | |
Store { get; init; } | ZplResourceStore | Emulated printer memory. Can be shared between renderers. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# 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() | void | Clears printer memory and label setup (power-on reset). |
Events
| Event | Handler Type | Description |
|---|---|---|
LabelRendered | EventHandler<ZplLabelRenderedEventArgs> | Raised for every rendered label (after encoding). |
PrinterControl | EventHandler<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…
public sealed class ZplResourceStorePrinter memory emulation: downloaded graphics (~DG, ~DY), stored formats (^DF) and fonts. Object names are case-insensitive; the drive letter (R:, E:, B:) is ignored.
ZplRenderer per thread). Downloads from ZPL (~DG, ~DY, ~DU, ^DF) are limited by ZplResourceStore.MaxTotalBytes; objects added through the API are not.Constructors
| Signature | Description |
|---|---|
# ZplResourceStore() |
Properties
| Property | Type | Description |
|---|---|---|
CacheGraphics { get; set; } | bool | Cache 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; } | int | Number of decoded graphics currently cached. |
Fonts { get; } | FontManager | |
Formats { get; } | IReadOnlyCollection<string> | |
Graphics { get; } | IReadOnlyCollection<string> | |
MaxCachedGraphics { get; set; } | int | Maximum number of decoded graphics kept while ZplResourceStore.CacheGraphics is on (default 64). |
MaxTotalBytes { get; set; } | long | Quota 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; } | long | Approximate memory used by stored graphics, formats and downloaded fonts in bytes. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# AddFormat(string name, IEnumerable<ZplCommand> commands) | void | |
# AddGraphic(string name, MonoBitmap graphic) | void | |
# AddGraphic(string name, SKBitmap image, bool dither = false) | void | |
# Clear() | void | Clears 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) | bool | Renames a downloaded/registered font (false when it doesn't exist or the new name is taken). |
# RenameFormat(string name, string newName) | bool | Renames a stored format (false when it doesn't exist or the new name is taken). |
# RenameGraphic(string name, string newName) | bool | Renames a stored graphic (false when it doesn't exist or the new name is taken). |
ZplRfidIndicator
RFID marker in previews (see ZplRenderSettings.RfidIndicator).
ZplRotation
ZplScanProof
Scan-proof (stage 1, barcode assurance): renders ZPL, then reads every barcode back from the rendered bitmap with two independe…
public static class ZplScanProofScan-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).
ScanProofDataStatus.NotDecodable). See docs-internal/scan-proof.md.Properties
| Property | Type | Description |
|---|---|---|
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
| Field | Type | Description |
|---|---|---|
const Disclaimer = "Digital pre-check modelled on ISO/IE…" | string | The wording every report carries. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
static # Verify(string zpl, ScanProofOptions? options = default) | ScanProofReport | Renders zpl and checks every barcode symbol on every label. |
static # Verify(Barcode barcode, ScanProofOptions? options = default) | ScanProofReport | Checks 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).
public enum ZplSvgModeHow SVG output is produced (see ZplRenderSettings.SvgMode).
Values
| Name | Value | Description |
|---|---|---|
Vector | 0 | Vector paths for shapes, barcodes and text (glyph outlines); graphics and reversed fields as images. |
TracedRaster | 1 | The rendered bitmap traced to rectangles. |
EmbeddedRaster | 2 | The 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…
public sealed class ZplTextEncoding : EncodingEncoding 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.
ZplTextEncoding.Decode). A ^CC that changes the caret is not followed.Constructors
| Signature | Description |
|---|---|
# ZplTextEncoding(int defaultCodePage = 850) | defaultCodePage: Code page before the first ^CI (850 like a Zebra printer at power-up). |
Properties
| Property | Type | Description |
|---|---|---|
EncodingName { get; } | string | |
IsSingleByte { get; } | bool | |
WebName { get; } | string |
Methods
| Method Signature | Returns | Description |
|---|---|---|
static # Decode(byte[] data, out Encoding encoding, int defaultCodePage = 850) | string | Decodes 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 typesStand-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).
Barcode
Stand-alone barcode generator (no ZPL needed): set Barcode.Symbology and Barcode.Code, then export as bitmap/PNG, vector PDF/SV…
public sealed class BarcodeStand-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.
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
| Signature | Description |
|---|---|
# Barcode() |
Properties
| Property | Type | Description |
|---|---|---|
AddChecksum { get; set; } | bool | |
Alignment { get; set; } | BarcodeAlignment | Position inside the target box (FitProportional / AutoSize). |
AntiAlias { get; set; } | bool | Anti-aliased bars and modules (default off: crisp edges at whole pixels). |
ArtBarImagePattern { get; set; } | SKBitmap | Image tiled as fill pattern of the bars / modules (instead of Barcode.ForeColor). |
AztecErrorCorrection { get; set; } | int | Aztec error correction in percent of the data (5..95, default 23). |
AztecFormat { get; set; } | AztecFormat | Aztec format (Auto = full range, as bwip-js; ZXing chooses when no other Aztec option is set). |
AztecLayers { get; set; } | int | Aztec layers (compact 1..4, full 1..32; 0 = automatic). |
BackColor { get; set; } | SKColor | |
BarHeight { get; set; } | double | Bar height of linear codes (2D codes ignore it; their modules are square). |
BarWidth { get; set; } | double | Narrow bar / module width. |
BarWidthReduction { get; set; } | double | Bar width reduction (ink spread compensation) in Barcode.Unit: every dark bar/module gets narrower by this amount. |
BarWidthReductionPercent { get; set; } | double | Bar width reduction in percent of the module width (added to Barcode.BarWidthReduction). |
BearerBarWidth { get; set; } | double | |
BearerBars { get; set; } | BearerBarStyle | Bearer bars (ITF-14 frame or horizontal rules). |
BorderColor { get; set; } | SKColor | |
BorderRadius { get; set; } | double | Corner radius of the border (and background) in Barcode.Unit. |
BorderWidth { get; set; } | double | Border line width in Barcode.Unit (0 = none). |
ByteEncodingName { get; set; } | string | Character 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; } | Code128Subset | Code 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; } | Code16KMode | Code 16K start mode (initial code set); Auto = BWIPP's choice. |
Code16KRows { get; set; } | int | Minimum number of Code 16K rows (2..16, 0 = automatic). |
CodeEncoding { get; set; } | CodeEncoding | |
CodeFormatPattern { get; set; } | string | Pattern applied to Barcode.Code before encoding (same syntax as Barcode.TextFormatPattern). |
CompositeComponent { get; set; } | CompositeComponent | Composite component of the GS1 composite symbologies. |
DataBarSegmentsPerRow { get; set; } | int | |
DataMatrixDmre { get; set; } | bool | Allow the DMRE (ISO/IEC 21471) rectangles in the automatic rectangular size selection. |
DataMatrixEncodation { get; set; } | DataMatrixEncodation | Data 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; } | string | Fixed Data Matrix size "RxC" (rows × columns), e.g. "24x24", "16x48"; DMRE sizes such as "8x48" are allowed. Null = smallest fitting. |
DisplayChecksum { get; set; } | bool | Show 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; } | double | DotCode width:height ratio for the automatic size (0 = 1.5). |
DotCodeColumns { get; set; } | int | DotCode columns (at least 5, 0 = automatic). |
DotCodeRows { get; set; } | int | DotCode rows (at least 5, 0 = automatic). With both rows and columns their sum must be odd. |
Dpi { get; set; } | int | Resolution for raster output and unit conversion. |
ErrorBehavior { get; set; } | BarcodeErrorBehavior | Error behaviour of the outputs (Barcode.Encode always throws). |
FinderShape { get; set; } | FinderShape | |
FontSize { get; set; } | double | Font size of the human readable text in points (0 = automatic, proportional to the module). |
ForeColor { get; set; } | SKColor | |
Gs1StrictValidation { get; set; } | bool | GS1-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; } | bool | Extend EAN/UPC guard bars into the text area. |
HanXinErrorCorrection { get; set; } | int | Han Xin error correction level 1..4 (L1..L4). |
HanXinMode { get; set; } | HanXinMode | Han Xin: force numeric, text or binary encodation for the whole message. |
HanXinVersion { get; set; } | int | Han Xin version 1..84 (0 = smallest fitting). |
HumanReadableAlignment { get; set; } | HumanReadableAlignment | |
HumanReadableText { get; set; } | string | Text instead of the encoded data (null = automatic, incl. check digits). |
ItfHMarks { get; set; } | bool | ITF-14: draw "H" marks in the quiet zones left and right of the symbol (inside the bearer frame). |
JabCodeColors { get; set; } | int | JAB Code colours: 4, 8 (default), 16, 32, 64, 128 or 256. |
JabCodeErrorCorrection { get; set; } | int | JAB Code error correction level 0..10 (default 6). |
JabCodeMask { get; set; } | int | JAB Code mask 0..7 (-1 = best). |
LightMarginIndicator { get; set; } | bool | EAN/UPC light margin indicators ('<' / '>') in the quiet zones (GS1 General Specifications). |
LogoBackground { get; set; } | bool | Draw a plate in Barcode.BackColor behind the logo. |
LogoImage { get; set; } | SKBitmap | Logo drawn in the center of 2D codes (QR: error correction is forced to H). |
LogoOpacity { get; set; } | double | Logo opacity 0..1. |
LogoPosition { get; set; } | LogoPosition | |
LogoSizePercent { get; set; } | double | Logo 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; } | bool | MaxiCode: draw the hexagons without anti-aliasing with centres snapped to whole pixels (crisp thermal output). |
MicroPdf417Columns { get; set; } | int | MicroPDF417 columns (1..4, 0 = automatic). |
MicroPdf417Rows { get; set; } | int | MicroPDF417 rows (per the ISO size table, 0 = automatic). |
MicroQrVersion { get; set; } | int | Micro 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; } | BarcodePadding | Margin around the barcode (outside the quiet zone, inside the border) in Barcode.Unit. |
Pdf417AspectRatio { get; set; } | double | PDF417 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; } | Pdf417Compaction | PDF417 compaction: Auto (text/numeric/byte optimisation), all Numeric, or all Binary (byte). |
Pdf417Rows { get; set; } | int | PDF417 rows (3..90, 0 = automatic). |
Pdf417SecurityLevel { get; set; } | int | |
PharmacodeSpacing { get; set; } | int | Pharmacode space between bars in modules (default 2). |
PharmacodeThickBar { get; set; } | int | Pharmacode thick bar width in modules (default 3). |
PharmacodeThinBar { get; set; } | int | Pharmacode thin bar width in modules (default 1). |
PostalBarSpacing { get; set; } | double | Postal codes: gap between bars in modules (default 1.5). |
PostalShortBarRatio { get; set; } | double | POSTNET/PLANET short bar height as fraction of Barcode.BarHeight (default 0.4). |
PostalTrackerRatio { get; set; } | double | 4-state postal codes: tracker height as fraction of Barcode.BarHeight (default 1/3). |
ProcessTilde { get; set; } | bool | Tilde 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; } | QrEncodingMode | QR 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; } | int | QR mask pattern 0–7 (-1 = automatic). |
QrVersion { get; set; } | int | QR 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; } | string | rMQR version, e.g. "R7x43" … "R17x139"; null = smallest area. |
RightToLeft { get; set; } | bool | Draw the human readable text right to left (character order reversed). |
Rotation { get; set; } | int | Rotation in degrees (0, 90, 180, 270). |
Size { get; } | SKSize | Size of the barcode (incl. quiet zone and text) in pixels at Barcode.Dpi, before rotation. |
Sizing { get; set; } | BarcodeSizing | Sizing mode; needs Barcode.TargetWidth and Barcode.TargetHeight (in Barcode.Unit, final orientation). |
StructuredAppendInfo { get; set; } | StructuredAppendInfo | Structured append for QR, Data Matrix, Aztec, MaxiCode and PDF417 (null = none). |
Supplement { get; set; } | string | EAN/UPC 2- or 5-digit supplement drawn right of the main symbol. |
SupplementSpacing { get; set; } | int | EAN/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; } | double | Output height for Barcode.Sizing (in Barcode.Unit). |
TargetWidth { get; set; } | double | Output width for Barcode.Sizing (in Barcode.Unit). |
TextColor { get; set; } | SKColor | |
TextFormatPattern { get; set; } | string | Format 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; } | int | TLC39: gap between the MicroPDF417 and the Code 39 part in modules (ZPL ^BT uses 2). |
Tlc39MicroPdfRowHeight { get; set; } | int | TLC39: height of one MicroPDF417 row in modules (ZPL ^BT h2; default 2). |
Typeface { get; set; } | SKTypeface | |
UltracodeErrorCorrection { get; set; } | int | Ultracode error correction level 1..5 (EC1..EC5, default 2). |
Unit { get; set; } | BarcodeUnit | Unit of Barcode.BarWidth, Barcode.BarHeight, Barcode.BearerBarWidth. |
UseQuietZoneForText { get; set; } | bool | Linear codes: the human readable text uses the quiet zone below (or above) the bars instead of adding height. |
WideRatio { get; set; } | double | Wide-to-narrow ratio for two-width codes (2.0–3.0). |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# Draw(SKCanvas canvas, float x = 0, float y = 0) | void | Draws the barcode with vector primitives onto any canvas (raster, PDF, SVG). |
# Encode() | BarcodeMatrix | Encodes Barcode.Code to modules. |
# IsCodeValid() | bool | True when Barcode.Code can be encoded with the current settings. |
# IsCodeValid(out string error) | bool | True when Barcode.Code can be encoded; otherwise error describes why. |
# StructuredAppend(int index, int count, int parity = -1, string? fileId = default) | Barcode | Sets structured append: symbol index (1-based) of count. |
# ToBitmap() | SKBitmap | |
# ToEps() | string | Encapsulated PostScript (vector bars, text in Courier). |
# ToEps(EpsColorMode colorMode) | string | Encapsulated PostScript in the given color model (RGB, CMYK or grayscale operators). |
# ToHtmlImgTag(HtmlImageFormat format = HtmlImageFormat.Png, string? alt = default) | string | HTML <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() | string | Vector 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) | string | The 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.
public enum BarcodeAlignmentPosition of the barcode inside the target box.
Values
| Name | Value | Description |
|---|---|---|
TopLeft | 0 | |
TopCenter | 1 | |
TopRight | 2 | |
MiddleLeft | 3 | |
MiddleCenter | 4 | |
MiddleRight | 5 | |
BottomLeft | 6 | |
BottomCenter | 7 | |
BottomRight | 8 |
BarcodeEncoder
Encodes data to barcode modules. 2D codes and EAN/UPC use ZXing.Net; Code 128 follows ZPL subset rules.
public static class BarcodeEncoderEncodes data to barcode modules. 2D codes and EAN/UPC use ZXing.Net; Code 128 follows ZPL subset rules.
Methods
| Method Signature | Returns | Description |
|---|---|---|
static # Encode(BarcodeType type, string data, BarcodeOptions? options = default) | BarcodeMatrix |
BarcodeErrorBehavior
What Barcode outputs do when the data cannot be encoded.
public enum BarcodeErrorBehaviorWhat Barcode outputs do when the data cannot be encoded.
Values
| Name | Value | Description |
|---|---|---|
Throw | 0 | Throw the encoder exception (default). |
BlankImage | 1 | Output an empty image in Barcode.BackColor. |
ErrorDescriptionImage | 2 | Output 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…
public sealed class BarcodeMatrixBarcode 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
| Signature | Description |
|---|---|
# BarcodeMatrix() |
Properties
| Property | Type | Description |
|---|---|---|
Height { get; } | int | |
Is2D { get; init; } | bool | |
required Modules { get; init; } | bool[] | |
Text { get; init; } | string | Human readable text (incl. check digits where applicable). |
UnitsPerModule { get; init; } | int | Matrix columns per narrow module (2 for two-width symbologies built in half units). |
Width { get; } | int |
BarcodeOptions
public sealed class BarcodeOptionsConstructors
| Signature | Description |
|---|---|
# BarcodeOptions() |
Properties
| Property | Type | Description |
|---|---|---|
Code128Automatic { get; set; } | bool | Code 128 subset optimization (ZPL ^BC mode A); false = ZPL mode N. |
Code39CheckDigit { get; set; } | bool | Add mod 43 check digit to Code 39 (^B3 e). |
Interleaved2of5CheckDigit { get; set; } | bool | |
MsiCheckDigits { get; set; } | MsiChecksum | MSI check digits (ZPL ^BM e: A none, B one mod 10 = default, C two mod 10, D mod 11 + mod 10). |
MsiCheckDigitsInText { get; set; } | bool | MSI: the check digits are part of BarcodeMatrix.Text (ZPL ^BM e2, Zebra default N). |
Pdf417Columns { get; set; } | int | |
Pdf417SecurityLevel { get; set; } | int | PDF417 security level 0..8 (ZPL ^B7 s). |
QrErrorCorrection { get; set; } | char | QR error correction L/M/Q/H. |
WideRatio { get; set; } | double | Wide:narrow ratio for two-width symbologies (ZPL ^BY r, 2.0..3.0). |
BarcodePadding
Space around the barcode in Barcode.Unit.
public readonly record struct BarcodePaddingSpace around the barcode in Barcode.Unit.
Constructors
| Signature | Description |
|---|---|
# BarcodePadding(double all) | |
# BarcodePadding(double Left, double Top, double Right, double Bottom) | Space around the barcode in Barcode.Unit. |
Properties
| Property | Type | Description |
|---|---|---|
Bottom { get; init; } | double | |
IsEmpty { get; } | bool | |
Left { get; init; } | double | |
Right { get; init; } | double | |
Top { get; init; } | double |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# 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.
public enum BarcodeSizingHow the barcode is fitted into Barcode.TargetWidth × Barcode.TargetHeight.
Values
| Name | Value | Description |
|---|---|---|
None | 0 | Natural size from the module width and bar height; the target is ignored. |
Fill | 1 | Stretch to fill the target (width and height scaled independently). |
FitProportional | 2 | Scale uniformly to fit inside the target, positioned by Barcode.Alignment. |
AutoSize | 3 | Largest whole-pixel module width whose symbol fits the target (bars stay crisp), positioned by Barcode.Alignment. |
BarcodeTextPosition
BarcodeType
BarcodeUnit
public enum BarcodeUnitValues
| Name | Value | Description |
|---|---|---|
Pixel | 0 | |
Millimeter | 1 | |
Inch | 2 | |
Mil | 3 | |
Centimeter | 4 | |
Micrometer | 5 |
BarcodeVariants
Application / data-format variants built on the existing carrier encoders (Code 128, GS1-128, ITF, Code 39, EAN, Data Matrix, Q…
public static class BarcodeVariantsApplication / 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 Signature | Returns | Description |
|---|---|---|
static # DhlAwb(string number) | BarcodeMatrix | DHL Air Waybill: 10 digits, last digit = first nine digits mod 7, in Code 128 C. |
static # Dun14Ean14(string data) | BarcodeMatrix | DUN-14 as GS1-128 (AI 01). |
static # Dun14Itf(string data) | BarcodeMatrix | DUN-14 as ITF-14 (check computed or verified). |
static # Ean99(string data) | BarcodeMatrix | EAN-99 (in-store coupon): EAN-13 starting with 99. 12 or 13 digits. |
static # FedExGround96(string number) | BarcodeMatrix | FedEx 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) | BarcodeMatrix | HIBC LIC/PAS in Aztec Code (BWIPP hibcazteccode). |
static # HibcCodablockF(string data) | BarcodeMatrix | HIBC LIC/PAS in Codablock F (BWIPP hibccodablockf). |
static # HibcDataMatrix(string data) | BarcodeMatrix | HIBC LIC/PAS in Data Matrix (BWIPP hibcdatamatrix). |
static # HibcMessage(string data) | string | HIBC message: "+" + data + mod 43 check (BWIPP hibc* encoders). |
static # HibcMicroPdf417(string data, int columns = 2) | BarcodeMatrix | HIBC LIC/PAS in MicroPDF417 (BWIPP hibcmicropdf417, default 2 columns). |
static # HibcQr(string data) | BarcodeMatrix | HIBC LIC/PAS in QR Code (BWIPP hibcqrcode, EC level M). |
static # IfaDataMatrix(string ppn, string? batch = default, string? expiry = default, string? serial = default) | BarcodeMatrix | IFA 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) | BarcodeMatrix | ISBT 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) | BarcodeMatrix | ISBT 128 Data Matrix: compound message "=+" + data structures (ICCBBA ST-014) in Data Matrix. |
static # ItalianPost2of5(string number) | BarcodeMatrix | Italian Post 2 of 5: Interleaved 2 of 5 with appended mod 10 check digit (leading zero pad to even). |
static # Jan8(string data) | BarcodeMatrix | JAN-8: EAN-8 whose GS1 prefix is 45 or 49 (Japan). 7 or 8 digits. |
static # Mod10(string digits) | char | GS1 mod 10 (weights 3/1 from the right) check digit of a digit string. |
static # Mod37_2(string s) | char | ISO 7064 mod 37-2 check character (ICCBBA ISBT 128 keyboard check; values 0-9, A-Z, '*'). |
static # Numly(string number) | BarcodeMatrix | Numly Number: 19 digits in Code 39. |
static # Ppn(string pznOrPpn) | string | IFA PPN: "11" + PZN (8 digits) + 2 check digits (Σ ASCII·weight, weights 2,3,4,… mod 97). |
static # PpnDataMatrix(string ppn) | BarcodeMatrix | IFA PPN-only Data Matrix (format 06 with DI 9N). |
static # Semacode(string url) | BarcodeMatrix | Semacode: a URL encoded in Data Matrix. |
static # SwissPostParcel(string number) | BarcodeMatrix | Swiss Post parcel number: 18 digits in Code 128 (subset C), text grouped "98.xx.xxxxxx.xxxxxxxx". |
static # UspsImpb(string tracking, string? zip = default) | BarcodeMatrix | USPS 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) | BarcodeMatrix | USPS PIC: same structure as BarcodeVariants.UspsImpb, typically AI 91 (no routing). |
static # UspsSackLabel(string number) | BarcodeMatrix | USPS 8-digit sack label (Interleaved 2 of 5). |
static # UspsTrayLabel(string number) | BarcodeMatrix | USPS 24-digit tray label (Interleaved 2 of 5). |
static # VicsBol(string number) | BarcodeMatrix | VICS Bill of Lading number: 17 digits (GS1 company prefix + serial + mod 10 check) in Code 128 C. |
static # VicsScacPro(string scac, string pro) | BarcodeMatrix | VICS SCAC PRO: 4-letter carrier SCAC + PRO number in Code 128 (digits use subset C). |
static # VinDataMatrix(string vin) | BarcodeMatrix | VIN as Data Matrix. |
static # VinQr(string vin) | BarcodeMatrix | VIN as QR Code (EC level M). |
BearerBarStyle
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…
public static class ChecksumsPublic 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 Signature | Returns | Description |
|---|---|---|
static # CodabarMod16(string data) | char | Codabar mod 16 check character over the data including start/stop characters. |
static # Code11(string data, bool twoDigits = true) | string | Code 11 C (and with twoDigits also K) check digits; '-' counts as 10. |
static # Code39Mod43(string data) | char | Code 39 mod 43 check character. |
static # Code93Mod47(string data) | string | Code 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) | int | Deutsche Post Leitcode / Identcode check digit (weights 4 and 9 from the left). |
static # DeutschePostMod11(string digits) | int | Deutsche Post mod 11 (weights 2..7 from the right; results 10 and 11 become 0). |
static # IsValidMod10(string digitsWithCheck) | bool | True when the last digit of digitsWithCheck is its GS1 mod 10 check digit. |
static # Iso7064Mod11_10(string digits) | int | ISO/IEC 7064 MOD 11-10 (hybrid system, numeric). |
static # Iso7064Mod37_2(string data) | char | ISO/IEC 7064 MOD 37-2 (alphanumeric, check character 0-9, A-Z or '*'); used by ISBT 128. |
static # Iso7064Mod97_10(string data) | int | ISO/IEC 7064 MOD 97-10 (as in IBAN): returns the two check digits 02..98. |
static # Luhn(string digits) | int | Luhn (mod 10, double every second digit from the right); also the MSI mod 10 check. |
static # Mod10(string digits) | int | GS1 mod 10 (weights 3,1 from the right): EAN/UPC, ITF-14, SSCC, GTIN, GLN. |
static # Mod10Weighted(string digits, params int[] weightsFromRight) | int | Weighted 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) | int | Mod 11 with weights 2..maxWeight from the right; returns 0..10 (10 is usually printed as 'X'). |
static # Msi(string digits, MsiChecksum kind) | string | MSI check digits: "Mod10", "Mod11", "Mod1010" (two mod 10) or "Mod1110" (mod 11 then mod 10). |
static # Ppn(string data) | string | PPN (pharmacy product number) check digits: mod 97 over the character values with weights 2, 3, 4 … |
static # UpuS10(string serial8) | int | UPU S10 check digit over the 8-digit serial number (weights 8,6,4,2,3,5,9,7). |
static # Vin(string vin) | char | VIN 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…
public static class CodablockCodablock 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
| Field | Type | Description |
|---|---|---|
const RowHeight = 10 | int | bwip-js default rowheight (matrix rows per symbol row). |
const SepHeight = 1 | int | bwip-js default sepheight (matrix rows per separator). |
Methods
| Method Signature | Returns | Description |
|---|---|---|
static # Encode(string data, int columns = 0, int rows = 0) | BarcodeMatrix | Encode 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 …
public static class Code128Code 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 Signature | Returns | Description |
|---|---|---|
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).
CodeEncoding
How Barcode.Code is interpreted before encoding.
ColorMatrix
A colour module matrix. ColorMatrix.Cells is indexed [x, y] and holds BWIPP colour indices: 0 = white (FFFFFF), 9 = black (0000…
public sealed class ColorMatrixA 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
| Signature | Description |
|---|---|
# ColorMatrix(int width, int height) | Creates an empty matrix. |
Properties
| Property | Type | Description |
|---|---|---|
Cells { get; } | int[] | Colour indices, [x, y]. |
Height { get; } | int | Height in modules. |
Width { get; } | int | Width in modules. |
Fields & Constants
| Field | Type | Description |
|---|---|---|
static readonly Palette | IReadOnlyDictionary<int, (string, string)> | Colour index to (name, RGB hex) as defined by BWIPP's ultracode colormap. |
CompositeComponent
GS1 composite component (Barcode.CompositeComponent).
public enum CompositeComponentGS1 composite component (Barcode.CompositeComponent).
Values
| Name | Value | Description |
|---|---|---|
Auto | 0 | CC-A, growing to CC-B (and to CC-C for GS1-128) when the data does not fit. |
CcA | 1 | Same as CompositeComponent.Auto: CC-A is used whenever the data fits. |
CcB | 2 | CC-B (MicroPDF417 based) even when CC-A would fit. |
CcC | 3 | CC-C (PDF417 based); GS1-128 composites only. |
DataMatrixEncodation
Data Matrix encodation scheme (Barcode.DataMatrixEncodation).
Eci
AIM Extended Channel Interpretation numbers of the common character encodings (AIM ITS/04-023).
public static class EciAIM Extended Channel Interpretation numbers of the common character encodings (AIM ITS/04-023).
Methods
| Method Signature | Returns | Description |
|---|---|---|
static # FromEncodingName(string name) | int | ECI number of an encoding name (IANA/.NET web name), e.g. "ISO-8859-5" → 7, "UTF-8" → 26. |
static # GetEncoding(string name) | Encoding | The .NET encoding of a name, including the code page encodings (Shift_JIS, windows-125x, Big5 …). |
FinderShape
Shape of the three QR finder patterns (7 × 7).
Gs1
GS1 Application Identifier parser and linter, following BWIPP's gs1process (AI table extracted from the GS1 Syntax Dictionary a…
public static class Gs1GS1 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
| Field | Type | Description |
|---|---|---|
const GS = | char | Group separator used for FNC1 in raw strings. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
static # NeedsSeparator(string ai) | bool | True when an FNC1 separator must follow this AI's value (unless it is last). |
static # Parse(string s, bool lintReqs = false) | Gs1Result | Parses either bracketed or raw form, depending on whether it starts with '('. |
static # ParseBracketed(string s, bool lintReqs = false) | Gs1Result | Parses "(AI)value(AI)value…" and lints it. |
static # ParseRaw(string raw, bool lintReqs = false) | Gs1Result | Parses 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 = "") | string | Raw 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.
public static class Gs1BuilderHelpers to build GS1 element strings ("(AI)value…") for the GS1 symbologies.
Methods
| Method Signature | Returns | Description |
|---|---|---|
static # Build(params (string, string)[] elements) | string | Element string of (AI, value) pairs, e.g. Build(("01", gtin), ("10", "LOT1")). |
static # CheckDigit(string digits) | int | GS1 mod-10 check digit of a digit string (GTIN, SSCC, GLN …). |
static # Date(string ai, DateOnly date) | string | Date AI value YYMMDD, e.g. Date("17", expiry) for (17) expiration date. |
static # Element(string ai, string value) | string | One element "(AI)value". |
static # Gtin(string gtin) | string | AI (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) | bool | True when the AI is defined in the GS1 table. |
static # IsValidCheckDigit(string digitsWithCheck) | bool | True when the last digit is the correct GS1 check digit. |
static # Measure(string ai3, decimal value, int decimals) | string | Measure 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) | string | AI (00): SSCC from 17 digits (check digit added) or 18 digits (validated). |
static # WithCheckDigit(string digits) | string | Digits with their GS1 check digit appended. |
Gs1DigitalLink
GS1 Digital Link URIs (GS1 Digital Link Standard: URI Syntax, release 1.7.0): build them from GS1 element strings, parse and va…
public static class Gs1DigitalLinkGS1 Digital Link URIs (GS1 Digital Link Standard: URI Syntax, release 1.7.0): build them from GS1 element strings, parse and validate them, and convert between both forms. Structure: https://{domain}[/{custom path}]/{primary key AI}/{value}[/{qualifier AI}/{value}…][?{AI}={value}&…]. The primary key (GTIN, SSCC, GLN …) and its key qualifiers (e.g. /22 CPV, /10 batch/lot, /21 serial, in this order) form the path; all other AIs are data attributes in the query string. The AI tables (primary keys, qualifier sequences, permitted data attributes) follow the ABNF of the standard and the GS1 Barcode Syntax Dictionary; value formats and check digits are validated with Gs1.Issue codes: scheme, characters, host, noPath, trailingSlash, noPrimaryKey, convenienceAlpha, pathPairs, unknownAi, emptyValue, mustPercentEncode, percentEncoding, notQualifier, qualifierOrder, qualifierRequired, gtinLength, queryKeyNumeric, belongsInPath, notDataAttribute, duplicateAi, aiValue, exclusiveAis; warnings: http, requisiteAis, doubleQuote, zeroSuppressedGtin, compressedLegacy, compressedEpc, compressedUndecodable.
Fields & Constants
| Field | Type | Description |
|---|---|---|
const DefaultStem = "https://id.gs1.org" | string | Default domain (stem) of canonical URIs: https://id.gs1.org. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
static # Build(string elementString, string? stem = default) | string | Builds an uncompressed GS1 Digital Link URI from element strings in bracketed form "(01)09520123456788(10)ABC" or raw form (FNC1 / GS U+001D separated, optional symbology identifier "]C1", "]d2", "]Q3"). elementString: The GS1 data. · stem: Domain and optional path prefix, e.g. "https://brand.example.com" or "https://example.com/products" (default Gs1DigitalLink.DefaultStem; a trailing slash is removed). |
static # Build(IEnumerable<Gs1Element> elements, string? stem = default) | string | Builds an uncompressed GS1 Digital Link URI from AI elements. The first primary key AI becomes the path root; the longest key qualifier sequence present in the data is put in the path in its mandatory order; the remaining AIs become data attributes in the query string in lexical order of the AI (the canonical order). Every value is validated (format, check digit, character set) and percent-encoded (every character except A–Z a–z 0–9 - . _ ~). |
static # Decompress(string compressedUri) | string | Decodes a URI compressed with the legacy algorithm of the GS1 Digital Link Standard 1.1/1.2 (binary AI encoding, base64url) into its uncompressed form on the same stem. That algorithm is superseded (URI Syntax 1.7.0 §6.1.2: not maintained, not approved for open supply chains) and retail POS requires uncompressed URIs, so this exists to read old labels; zplCore does not compress. The EPC-binary compression ('eh'/'ex' flags) is not supported. |
static # IsDataAttribute(string ai) | bool | True when the AI may appear as a data attribute in the query string. |
static # IsPrimaryKey(string ai) | bool | True when the AI is a primary key of a GS1 Digital Link URI (01, 00, 414, 8004 …). |
static # KeyQualifiers(string primaryKey) | IReadOnlyList<IReadOnlyList<string>> | Key qualifier sequences of a primary key, e.g. for "01": [["22","10","21"], ["235"]] (each list in path order, each qualifier optional except (8020) after (415)); empty when the key has no qualifiers or is not a key. |
static # NormalizeGtin(string gtin) | string | A GTIN-8, GTIN-12, GTIN-13 or GTIN-14 as the 14-digit value of AI (01) (leading zeros added, check digit verified). |
static # Parse(string uri, Gs1DigitalLinkParseOptions? options = default) | Gs1DigitalLinkResult | Parses and validates a GS1 Digital Link URI against URI Syntax 1.7.0: scheme, host, custom path, primary key, key qualifier sequence and order, 14-digit GTIN, percent-encoding, data attributes (permitted AIs, AIs that belong in the path, all-numeric extension keys), duplicate AIs, AI value formats and check digits, invalid AI pairs. Missing requisite AIs (GenSpecs §4.13.2) are warnings, because another carrier on the item may hold them. Legacy compressed URIs are decoded (see Gs1DigitalLinkParseOptions.DecodeLegacyCompression). |
static # PercentEncode(string value) | string | Percent-encodes every character except the RFC 3986 unreserved set (A–Z a–z 0–9 - . _ ~), upper-case hex, UTF-8. This covers every character URI Syntax §4.1 requires to be encoded (# / % & + , ! ( ) * ' : ; < = > ?). |
static # ToElementString(string uri, bool bracketed = true) | string | Element string of a GS1 Digital Link URI, bracketed "(01)…(17)…(10)…" or raw (GS separators). |
static # TryBuild(IEnumerable<Gs1Element> elements, string stem, out string uri, out IReadOnlyList<Gs1DigitalLinkIssue> errors) | bool | Like Gs1DigitalLink.Build but returns the problems instead of throwing. |
Gs1DigitalLinkIssue
A problem found while parsing or building a GS1 Digital Link URI. Gs1DigitalLinkIssue.Code is stable (see Gs1DigitalLink for th…
public record Gs1DigitalLinkIssueA 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
| Signature | Description |
|---|---|
# 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
| Property | Type | Description |
|---|---|---|
Ai { get; init; } | string | The Application Identifier concerned, if any. |
Code { get; init; } | string | Stable code, e.g. "qualifierOrder" or "gtinLength". |
Message { get; init; } | string | Explanation in English. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# Deconstruct(out string Code, out string Message, out string Ai) | void |
Gs1DigitalLinkParseOptions
Options for Gs1DigitalLink.Parse.
public sealed class Gs1DigitalLinkParseOptionsOptions for Gs1DigitalLink.Parse.
Constructors
| Signature | Description |
|---|---|
# Gs1DigitalLinkParseOptions() |
Properties
| Property | Type | Description |
|---|---|---|
DecodeLegacyCompression { get; init; } | bool | Try 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; } | bool | Accept 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; } | bool | Accept 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.
public sealed class Gs1DigitalLinkResultResult of Gs1DigitalLink.Parse.
Properties
| Property | Type | Description |
|---|---|---|
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; } | string | Fragment after '#' (not sent to a server; ignored for the GS1 data), or null. |
Gtin { get; } | string | The GTIN (AI 01) in the path or query, or null. |
Host { get; } | string | Host name with optional port, e.g. "id.gs1.org" or "brand.example.com:8443". |
IsCompressed { get; } | bool | The URI uses the legacy compression (decoded by Gs1DigitalLink.Decompress). |
IsDigitalLink { get; } | bool | The input has the structure of a GS1 Digital Link URI: an http(s) URI whose path ends in a primary key and its value (possibly with errors in the details), or a legacy compressed URI that could be decoded. |
IsValid { get; } | bool | Gs1DigitalLinkResult.IsDigitalLink and no errors. |
PathElements { get; } | IReadOnlyList<Gs1Element> | Primary key and key qualifiers in path order (values percent-decoded). |
PrimaryKey { get; } | string | AI 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; } | string | Everything 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; } | string | The input. |
Warnings { get; } | IReadOnlyList<Gs1DigitalLinkIssue> | Recommendations and tolerated legacy forms (http instead of https, compressed form …). |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# ToCanonicalUri() | string | The 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) | string | The 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) | string | Value of the first element with this AI (path or query), or null. |
Gs1Element
One GS1 element: Application Identifier and its value.
public record Gs1ElementOne GS1 element: Application Identifier and its value.
Constructors
| Signature | Description |
|---|---|
# Gs1Element(string Ai, string Value) | One GS1 element: Application Identifier and its value. |
Properties
Methods
| Method Signature | Returns | Description |
|---|---|---|
# Deconstruct(out string Ai, out string Value) | void |
Gs1Error
A GS1 validation error (BWIPP error code without the "bwipp." prefix, and message).
public record Gs1ErrorA GS1 validation error (BWIPP error code without the "bwipp." prefix, and message).
Constructors
| Signature | Description |
|---|---|
# Gs1Error(string Ai, string Code, string Message) | A GS1 validation error (BWIPP error code without the "bwipp." prefix, and message). |
Properties
| Property | Type | Description |
|---|---|---|
Ai { get; init; } | string | |
Code { get; init; } | string | |
Message { get; init; } | string |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# Deconstruct(out string Ai, out string Code, out string Message) | void |
Gs1Result
Parsed GS1 data and any validation errors.
public record Gs1ResultParsed GS1 data and any validation errors.
Constructors
| Signature | Description |
|---|---|
# Gs1Result(IReadOnlyList<Gs1Element> Elements, IReadOnlyList<Gs1Error> Errors) | Parsed GS1 data and any validation errors. |
Properties
| Property | Type | Description |
|---|---|---|
Elements { get; init; } | IReadOnlyList<Gs1Element> | |
Errors { get; init; } | IReadOnlyList<Gs1Error> | |
IsValid { get; } | bool |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# Deconstruct(out IReadOnlyList<Gs1Element> Elements, out IReadOnlyList<Gs1Error> Errors) | void |
HanXinMode
Code 16K start mode (Barcode.Code16KMode): initial code set A, B or C.
public enum HanXinModeCode 16K start mode (Barcode.Code16KMode): initial code set A, B or C.
Values
HumanReadableAlignment
Isbt128Data
Builds ISBT 128 data structure strings (data identifier + validated content) for Symbology.Isbt128.
public static class Isbt128DataBuilds ISBT 128 data structure strings (data identifier + validated content) for Symbology.Isbt128.
Methods
| Method Signature | Returns | Description |
|---|---|---|
static # Build(Isbt128DataStructure ds, string content) | string | Data 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) | char | The 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.
public enum Isbt128DataStructureISBT 128 data structures (ICCBBA ST-001) with their data identifiers.
Values
| Name | Value | Description |
|---|---|---|
DonationIdentificationNumber | 1 | DS001 Donation Identification Number: "=" + αppppyynnnnnn + flags ff (15 characters). |
BloodGroups | 2 | DS002 Blood Groups [ABO and RhD]: "=%" + ggre. |
ProductCode | 3 | DS003 Product Code: "=<" + αooootds. |
ExpirationDate | 4 | DS004 Expiration Date: "=>" + cyyjjj. |
ExpirationDateAndTime | 5 | DS005 Expiration Date and Time: "&>" + cyyjjjhhmm. |
CollectionDate | 6 | DS006 Collection Date: "=*" + cyyjjj. |
CollectionDateAndTime | 7 | DS007 Collection Date and Time: "&*" + cyyjjjhhmm. |
ProductionDate | 8 | DS008 Production Date: "=}" + cyyjjj. |
ProductionDateAndTime | 9 | DS009 Production Date and Time: "&}" + cyyjjjhhmm. |
SpecialTestingGeneral | 10 | DS010 Special Testing: General: "&(" + zzzzz. |
SpecialTestingRbcAntigens | 11 | DS011 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…
public static class JabCodeJAB 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 Signature | Returns | Description |
|---|---|---|
static # Encode(string data, int colors = 8, int eclevel = 6, int rows = -1, int columns = -1, int mask = -1) | JabCodeSymbol | Encodes 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) | JabCodeSymbol | Encodes raw bytes. |
JabCodeSymbol
A JAB Code symbol: palette indices per module ([x, y]) and the palette as RGB hex strings.
public sealed class JabCodeSymbolA JAB Code symbol: palette indices per module ([x, y]) and the palette as RGB hex strings.
Properties
LogoPosition
Position of the logo of 2D codes.
MicroPdf417
MicroPDF417 (ISO/IEC 24728), bit-exact with BWIPP micropdf417 (non-composite). Data is UTF-8 bytes (as bwip-js; ^BF as a Zebra …
public static class MicroPdf417MicroPDF417 (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
| Field | Type | Description |
|---|---|---|
const RowHeight = 2 | int | BWIPP default row multiplier (each symbol row is 2 modules high in bwip-js pixs). |
Methods
| Method Signature | Returns | Description |
|---|---|---|
static # Encode(string data, int columns = 0, int rows = 0) | BarcodeMatrix | Encodes 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.
public enum ModuleShapeShape of the dark modules of 2D matrix codes.
Values
| Name | Value | Description |
|---|---|---|
Square | 0 | |
Circle | 1 | |
RoundedSquare | 2 | |
Diamond | 3 | |
Dot | 4 | |
ZebraHorizontal | 5 | |
ZebraVertical | 6 |
MsiChecksum
MSI Plessey check digit variants.
Pdf417
PDF417 (ISO/IEC 15438) encoder, bit-exact with BWIPP pdf417 / pdf417compact. Data is taken as UTF-8 bytes (as bwip-js does; ^B7…
public static class Pdf417PDF417 (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
| Field | Type | Description |
|---|---|---|
const RowHeight = 3 | int | BWIPP default row multiplier (each symbol row is 3 modules high in bwip-js pixs). |
Methods
| Method Signature | Returns | Description |
|---|---|---|
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) | BarcodeMatrix | Encodes 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) | BarcodeMatrix | Macro 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).
PostalExtra
Additional postal / logistics symbologies ported from zint: Korea Post, Royal Mail Mailmark 4-state (C and L), DPD, UPU S10, De…
public static class PostalExtraAdditional 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 Signature | Returns | Description |
|---|---|---|
static # Bc412(string data) | BarcodeMatrix | IBM 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) | BarcodeMatrix | DPD 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) | BarcodeMatrix | Deutsche Post Flattermarken: up to 128 digits. |
static # KoreaPost(string data) | BarcodeMatrix | Korea Post: up to 6 digits (zero-filled on the left) plus a mod-10 check digit. |
static # Mailmark4State(string data) | BarcodeMatrix | Royal 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) | BarcodeMatrix | UPU S10 item identifier: 2 letters, 8 digits (+ optional check digit), 2-letter country code. |
QrEncodingMode
QR Code data mode (Barcode.QrEncodingMode).
public enum QrEncodingModeQR Code data mode (Barcode.QrEncodingMode).
Values
| Name | Value | Description |
|---|---|---|
Auto | 0 | |
Numeric | 1 | |
Alphanumeric | 2 | |
Byte | 3 | |
Kanji | 4 |
QrExtras
GS1 QR Code, Swiss QR Code and EPC (SEPA credit transfer) QR helpers.
public static class QrExtrasGS1 QR Code, Swiss QR Code and EPC (SEPA credit transfer) QR helpers.
Methods
| Method Signature | Returns | Description |
|---|---|---|
static # Epc(string payload) | BarcodeMatrix | EPC 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) | string | Builds 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') | BarcodeMatrix | GS1 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') | BarcodeMatrix | GS1 rMQR (ISO/IEC 23941 with FNC1 in first position) from bracketed AI syntax; version null = smallest area. |
static # SwissQr(string payload) | SwissQrResult | Swiss 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.
public record StructuredAppendInfoStructured append parameters. StructuredAppendInfo.Index is 1-based.
Constructors
| Signature | Description |
|---|---|
# 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
| Property | Type | Description |
|---|---|---|
Count { get; init; } | int | Total number of symbols in the sequence. |
FileId { get; init; } | string | PDF417 macro file id (3-digit groups) / Aztec message ID (A–Z). |
Index { get; init; } | int | Position of this symbol in the sequence (1-based). |
Parity { get; init; } | int | QR parity byte (-1 = XOR of this symbol's data bytes); Data Matrix file id. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# 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…
public record SwissCrossOverlay 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
| Signature | Description |
|---|---|
# 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
| Property | Type | Description |
|---|---|---|
ArmLengthFraction { get; init; } | double | Tip-to-tip length of the white cross, relative to cross side (47/83). |
ArmWidthFraction { get; init; } | double | Width of the white cross arms, relative to cross side (15/83). |
BlackInsetFraction { get; init; } | double | White border around the black square, relative to cross side (6/83). |
SizeFraction { get; init; } | double | Cross square side / symbol side (7/46), centred on the symbol. |
SizeModules { get; init; } | double | Cross square side in modules. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# 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.
public record SwissQrResultSwiss QR Code result: plain QR modules (no cross, identical to bwip-js pixs) plus the cross overlay.
Constructors
| Signature | Description |
|---|---|
# SwissQrResult(BarcodeMatrix Matrix, SwissCross Cross) | Swiss QR Code result: plain QR modules (no cross, identical to bwip-js pixs) plus the cross overlay. |
Properties
| Property | Type | Description |
|---|---|---|
Cross { get; init; } | SwissCross | |
Matrix { get; init; } | BarcodeMatrix |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# Deconstruct(out BarcodeMatrix Matrix, out SwissCross Cross) | void |
Symbology
All symbologies of the stand-alone barcode generator.
public enum SymbologyAll symbologies of the stand-alone barcode generator.
Values
Tlc39
TLC39 (Telecommunications Industry Bar Code, ANSI/TIA-1069 as implemented by ZPL ^BT): a Code 39 symbol carrying the 6-digit EC…
public static class Tlc39TLC39 (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 Signature | Returns | Description |
|---|---|---|
static # Encode(string data, int wideRatio = 3, int linearHeight = 20, int gap = 2, int microRowHeight = 2, int microColumns = 0, int microRows = 0) | BarcodeMatrix | Encodes 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…
public static class UpnQrUPNQR (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 Signature | Returns | Description |
|---|---|---|
static # Encode(string payload) | BarcodeMatrix | Encodes the UPN payload (Unicode text, must be representable in ISO-8859-2; at most 411 bytes). |
ZplCore.Compliance #
18 typesPre-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.
public sealed class ComplianceBarcode : ComplianceElementA barcode with geometry measured on the rendered label.
Properties
| Property | Type | Description |
|---|---|---|
BarHeightDots { get; } | int | Bar height in dots (linear codes: scan lines that cross the complete symbol); 0 for 2D. |
BarHeightMm { get; } | double | |
Data { get; } | string | Data 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; } | Gs1Result | Parsed and validated GS1 element strings when ComplianceBarcode.IsGs1 (null otherwise). |
InterpretationAbove { get; } | bool | The interpretation line is printed above the bars (^BC g = Y). |
InterpretationBounds { get; } | ComplianceRect | Area of the printed interpretation line (empty when none was found). |
InterpretationCharHeightDots { get; } | int | Character height of the interpretation line in dots (measured like ComplianceText.CharHeightDots). |
InterpretationCharHeightMm { get; } | double | |
InterpretationLine { get; } | bool | The command asks for a printed interpretation line (e.g. ^BC f = Y, the default). |
InterpretationText { get; } | string | Text the printer prints as interpretation line (data without invocation codes; ^BC mode D: the field data as written, without spaces). |
Is2D { get; } | bool | True for matrix and stacked symbologies (QR, Data Matrix, Aztec, MaxiCode, PDF417 …). |
IsGs1 { get; } | bool | The symbol carries GS1 element strings (FNC1 in first position: GS1-128, GS1 DataMatrix, GS1 QR Code). |
IsLinear { get; } | bool | True for single-row 1D symbologies (bars measured per scan line). |
ModuleDots { get; } | int | Narrowest bar or space (linear) or module (2D) measured in dots; 0 when it could not be measured. |
SymbolBounds { get; } | ComplianceRect | Area 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; } | double | X-dimension in mm (ComplianceBarcode.ModuleDots at the label resolution). |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# Ai(string ai) | string | Value 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…
public class ComplianceElementOne 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
| Property | Type | Description |
|---|---|---|
Arguments { get; } | IReadOnlyList<string> | Arguments of the element command (^BC → orientation, height, …), split at the delimiter. |
Bounds { get; } | ComplianceRect | Area of the element on the label in dots (as traced by the renderer). |
Column { get; } | int | |
Command { get; } | string | Command that drew the element, with prefix: "^BC", "^A0", "^GB", "^FD" (text without ^A) … |
Content { get; } | string | Field 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; } | int | Length of the field's source block up to and including ^FS. |
Line { get; } | int | |
Offset { get; } | int | Character offset of the field's first command in the ZPL (-1 when unknown). |
Orientation { get; } | char | N, R, I or B. |
Reverse { get; } | bool | Printed white on black (^FR / ^LR). |
Methods
ComplianceElementKind
Kind of a rendered element.
ComplianceFinding
One result of a compliance pre-check.
public record ComplianceFindingOne result of a compliance pre-check.
Constructors
| Signature | Description |
|---|---|
# ComplianceFinding() |
Properties
| Property | Type | Description |
|---|---|---|
Advisory { get; init; } | bool | True 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; } | int | 1-based source column (0 when not applicable). |
Command { get; init; } | string | ZPL command the finding refers to, e.g. "^BC" (empty for label-wide findings). |
LabelIndex { get; init; } | int | 0-based index of the rendered label (in print order) the finding belongs to; -1 for the whole input. |
Length { get; init; } | int | Length of the field's source block (up to and including ^FS); 0 when not applicable. |
Line { get; init; } | int | 1-based source line (0 when not applicable). |
required Message { get; init; } | string | Human-readable message (may change between versions; ComplianceFinding.RuleId is stable). |
Offset { get; init; } | int | Character offset of the field (its first command, usually ^FO) in the ZPL source; -1 when not applicable. |
required PackId { get; init; } | string | Id of the pack that ran the rule, e.g. "gs1-logistic". |
required RuleId { get; init; } | string | Stable rule code, e.g. "ZPL3104". |
required Severity { get; init; } | ComplianceSeverity | |
Source { get; init; } | string | Citation of the requirement. |
Suggestion { get; init; } | string | How to fix it (optional). |
ComplianceLabel
One rendered label prepared for compliance rules: size, resolution, elements with measured geometry and the rendered ink, so ru…
public sealed class ComplianceLabelOne 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
| Property | Type | Description |
|---|---|---|
Barcodes { get; } | IEnumerable<ComplianceBarcode> | |
Bounds { get; } | ComplianceRect | The 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; } | bool | The ZPL declares the length (^LL). |
HasPrintWidth { get; } | bool | The ZPL declares the width (^PW). |
Height { get; } | int | Label height in dots (^LL or the default size). |
HeightMm { get; } | double | |
Index { get; } | int | 0-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; } | string | The complete ZPL source that was checked. |
Texts { get; } | IEnumerable<ComplianceText> | |
Width { get; } | int | Label width in dots (^PW or the default size). |
WidthMm { get; } | double |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# InkBounds(ComplianceRect r) | ComplianceRect | Tight bounds of the ink inside r (empty when there is none). |
# InkCount(ComplianceRect r) | int | Number of inked dots inside r (the part on the label). |
# IsInk(int x, int y) | bool | Ink at a dot (false outside the label). |
# LastCommand(string name) | string | Command 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.
public sealed class ComplianceOptionsSettings of a compliance pre-check.
Constructors
| Signature | Description |
|---|---|
# ComplianceOptions() |
Properties
| Property | Type | Description |
|---|---|---|
DefaultLabelHeightMm { get; set; } | double | Label height in mm used when the ZPL has no ^LL (default 6 in = 152.4 mm). |
DefaultLabelWidthMm { get; set; } | double | Label 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; } | int | Print 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; } | bool | Report advisory findings (recommendations, unverified values). Default true. |
MinimumSeverity { get; set; } | ComplianceSeverity | Findings 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-…
public enum CompliancePacksBuilt-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]
| Name | Value | Description |
|---|---|---|
None | 0 | |
Gs1LogisticLabel | 0x1 | GS1 logistic label (SSCC, GS1-128): GS1 General Specifications §5.4, §5.12.3.5, §6.6, GS1 Logistic Label Guideline. |
Sunrise2027 | 0x2 | Sunrise 2027 / GS1 2D at retail: GTIN in GS1 DataMatrix or QR Code with GS1 Digital Link URI. |
AmazonFba | 0x4 | Amazon FBA unit (FNSKU), box and pallet labels (Amazon Seller Central help pages). |
Ups | 0x8 | UPS shipping labels: MaxiCode structured carrier message (modes 2/3), 1Z tracking number, 4 × 6 in. |
Udi | 0x10 | Medical device UDI (FDA 21 CFR 801 / 830, EU MDR Annex VI) with GS1 AIs (01)(11)(17)(10)(21). |
FedEx | 0x20 | FedEx basics from the public FedEx Ship API documentation (label sizes, PDF417, quiet zones). |
DhlPaket | 0x40 | DHL Paket (Germany) basics from the public DHL Parcel DE Shipping API (label formats, 203 dpi, Leitcode/Identcode). |
Rfid | 0x80 | RFID: 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. |
All | 0xFF | All built-in packs. |
ComplianceRect
Axis-aligned rectangle in printer dots (label coordinates, origin top left).
public readonly record struct ComplianceRectAxis-aligned rectangle in printer dots (label coordinates, origin top left).
Constructors
| Signature | Description |
|---|---|
# ComplianceRect(int X, int Y, int Width, int Height) | Axis-aligned rectangle in printer dots (label coordinates, origin top left). |
Properties
| Property | Type | Description |
|---|---|---|
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 Signature | Returns | Description |
|---|---|---|
# Contains(ComplianceRect o) | bool | True 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) | ComplianceRect | Grown by dx left and right and dy top and bottom. |
# Intersect(ComplianceRect o) | ComplianceRect | The common area (empty when the rectangles do not intersect). |
# Intersects(ComplianceRect o) | bool | True when both rectangles share at least one dot. |
# Union(ComplianceRect o) | ComplianceRect | The smallest rectangle containing both. |
ComplianceReport
Result of ZplCompliance.Check: findings plus JSON, SARIF and text output.
public sealed class ComplianceReportResult of ZplCompliance.Check: findings plus JSON, SARIF and text output.
Properties
| Property | Type | Description |
|---|---|---|
Dpi { get; } | int | Resolution 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; } | int | Number 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
| Field | Type | Description |
|---|---|---|
const Disclaimer = "Pre-check against public specificati…" | string | Wording used in every output: this is a pre-check, not a certification. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# Fails(ComplianceSeverity failOn) | bool | True when a finding has at least severity failOn (for CI gates). |
# ToJson(bool indented = true) | string | Findings as JSON (tool, dpi, packs, summary, findings with bounds in dots and mm). |
# ToSarif(string? artifactUri = default) | string | SARIF 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) | string | Plain text: one line per finding and a summary line. |
# WithFindings(IEnumerable<ComplianceFinding> findings) | ComplianceReport | A 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).
public sealed class ComplianceReporterCollects the findings of one rule on one label (passed to ComplianceRule.Check).
Methods
| Method Signature | Returns | Description |
|---|---|---|
# Add(string message, ComplianceElement? element = default, ComplianceSeverity? severity = default, ComplianceRect? bounds = default, string? suggestion = default) | void | Reports 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 …
public abstract class ComplianceRuleA 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
| Property | Type | Description |
|---|---|---|
Info { get; } | ComplianceRuleInfo | Stable id, title, citation and default severity. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# Check(ComplianceLabel label, ComplianceReporter report) | void | Checks one label; report problems through report. |
static # Create(ComplianceRuleInfo info, Action<ComplianceLabel, ComplianceReporter> check) | ComplianceRule | A rule from a delegate. |
# ToString() | string |
ComplianceRuleInfo
Static description of a rule (stable ComplianceRuleInfo.Id, citation, default severity).
public record ComplianceRuleInfoStatic description of a rule (stable ComplianceRuleInfo.Id, citation, default severity).
Constructors
| Signature | Description |
|---|---|
# 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
| Property | Type | Description |
|---|---|---|
Advisory { get; init; } | bool | 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. |
DefaultSeverity { get; init; } | ComplianceSeverity | Severity of findings unless the rule reports another one or options override it. |
Description { get; init; } | string | What the rule checks and how (one or two sentences). |
HelpUri { get; init; } | string | Public URL of the source, if any. |
Id { get; init; } | string | Stable code, e.g. "ZPL3101". Custom rules should use an own prefix (e.g. "ACME001"). |
Source { get; init; } | string | Citation of the requirement (document, release, section), e.g. "GS1 General Specifications 26.0 §5.4.4.2". |
Title { get; init; } | string | Short name shown in reports. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# 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 …
public sealed class ComplianceRulePackA 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
| Signature | Description |
|---|---|
# ComplianceRulePack(string id, string name, string version, IEnumerable<ComplianceRule> rules, string? description = default) |
Properties
| Property | Type | Description |
|---|---|---|
static AmazonFba { get; } | ComplianceRulePack | Amazon FBA unit (FNSKU), box and pallet labels. |
static BuiltIn { get; } | IReadOnlyList<ComplianceRulePack> | All built-in packs. |
Description { get; } | string | |
static DhlPaket { get; } | ComplianceRulePack | DHL Paket Germany basics (public Parcel DE Shipping API). |
static FedEx { get; } | ComplianceRulePack | FedEx basics (public Ship API documentation). |
static Gs1LogisticLabel { get; } | ComplianceRulePack | GS1 logistic label: SSCC in GS1-128, symbol specification table 5, HRI and label layout. |
Id { get; } | string | Short id used on the command line, e.g. "gs1-logistic". |
Name { get; } | string | |
static Rfid { get; } | ComplianceRulePack | RFID: EPC per GS1 TDS 2.3, EPC consistent with the printed barcodes, ZPL RFID command usage. |
Rules { get; } | IReadOnlyList<ComplianceRule> | |
static Sunrise2027 { get; } | ComplianceRulePack | Sunrise 2027: GTIN in GS1 DataMatrix or QR Code / Data Matrix with GS1 Digital Link URI next to EAN/UPC. |
static Udi { get; } | ComplianceRulePack | Medical device UDI with GS1 AIs (FDA 21 CFR 801/830, EU MDR Annex VI). |
static Ups { get; } | ComplianceRulePack | UPS: MaxiCode structured carrier message, 1Z tracking number, 4 × 6 / 4 × 8 in. |
Version { get; } | string | State of the sources the rules follow, e.g. "2026-10". |
Methods
| Method Signature | Returns | Description |
|---|---|---|
static # Find(string id) | ComplianceRulePack | A 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) | ComplianceRulePack | This pack plus rules. |
# Without(params string[] ruleIds) | ComplianceRulePack | This pack without the rules with these ids. |
ComplianceSeverity
Severity of a ComplianceFinding (maps to SARIF note, warning, error).
public enum ComplianceSeveritySeverity of a ComplianceFinding (maps to SARIF note, warning, error).
Values
ComplianceSymbology
Barcode symbology of a ZPL barcode command.
public enum ComplianceSymbologyBarcode symbology of a ZPL barcode command.
Values
| Name | Value | Description |
|---|---|---|
Unknown | 0 | |
Code128 | 1 | |
Code39 | 2 | |
Code93 | 3 | |
Code11 | 4 | |
Ean13 | 5 | |
Ean8 | 6 | |
UpcA | 7 | |
UpcE | 8 | |
UpcEanExtension | 9 | |
Interleaved2of5 | 10 | |
Industrial2of5 | 11 | |
Standard2of5 | 12 | |
Codabar | 13 | |
Msi | 14 | |
Plessey | 15 | |
Logmars | 16 | |
Postal | 17 | |
DataBar | 18 | |
Pdf417 | 19 | |
MicroPdf417 | 20 | |
Codablock | 21 | |
Code49 | 22 | |
Tlc39 | 23 | |
QrCode | 24 | |
DataMatrix | 25 | |
Aztec | 26 | |
MaxiCode | 27 |
ComplianceText
A text field with its measured character height.
public sealed class ComplianceText : ComplianceElementA text field with its measured character height.
Properties
| Property | Type | Description |
|---|---|---|
CharHeightDots { get; } | int | Character 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; } | double | ComplianceText.CharHeightDots in mm at the label resolution. |
FontHeightDots { get; } | int | Font height parameter in dots (^A h, else ^CF h; 0 when unknown). |
CoreRules
Rules every check runs (pack "core").
public static class CoreRulesRules every check runs (pack "core").
Properties
| Property | Type | Description |
|---|---|---|
static All { get; } | IReadOnlyList<ComplianceRuleInfo> | All core rules. |
Fields & Constants
| Field | Type | Description |
|---|---|---|
static readonly NoLabel | ComplianceRuleInfo | ZPL3000: the input contains no printable label. |
static readonly RenderProblem | ComplianceRuleInfo | ZPL3001: the renderer reported a field that could not be drawn (see DIAGNOSTICS.md). |
static readonly RuleFailed | ComplianceRuleInfo | ZPL3002: 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…
public static class ZplComplianceLabel 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
| Field | Type | Description |
|---|---|---|
const CorePackId = "core" | string | Rule id of findings that are not tied to a pack ("core" pack). |
Methods
| Method Signature | Returns | Description |
|---|---|---|
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) | ComplianceReport | Checks zpl with the built-in packs selected by packs. |
static # Check(string zpl, IEnumerable<ComplianceRulePack> packs, ComplianceOptions? options = default) | ComplianceReport | Checks zpl with the given packs (built-in or custom). |
static # Check(byte[] zpl, IEnumerable<ComplianceRulePack> packs, ComplianceOptions? options = default) | ComplianceReport | Checks 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 typesSpecialized 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 …
public static class EscPosNvESC/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 Signature | Returns | Description |
|---|---|---|
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.
LabelLanguageWriter
Writes a Label in other printer languages. Items with a native equivalent become commands; everything else is rendered through …
public static class LabelLanguageWriterWrites 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 Signature | Returns | Description |
|---|---|---|
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") | string | EPL2 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) | string | Fingerprint (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) | string | Fingerprint 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 …
public static class OutputEncoderFinal output stage: post-processing (flip, paper orientation, scaling, transparent paper) and encoding of rendered labels with all format options of ZplRenderSettings.
Methods
| Method Signature | Returns | Description |
|---|---|---|
static # Encode(IReadOnlyList<SKBitmap> labels, ZplRenderSettings s) | List<byte[]> | Post-processes and encodes all labels per ZplRenderSettings.OutputFormat. |
static # PostProcess(SKBitmap bitmap, ZplRenderSettings s) | SKBitmap | Applies 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) | SKBitmap | Mirrors and/or turns the bitmap 90° clockwise. |
PclColorMode
Raster data layout for PCL output.
public enum PclColorModeRaster data layout for PCL output.
Values
| Name | Value | Description |
|---|---|---|
Monochrome | 0 | 1 bit per pixel (black/white), works on every PCL 5 printer. |
Grayscale | 1 | 8-bit indexed with a 256-entry gray palette (PCL 5c). |
Color | 2 | 24-bit RGB, direct by pixel (PCL 5c). |
PclCompression
PCL raster compression method (ESC * b # M).
PclOptions
Options for PclWriter.
public sealed class PclOptionsOptions for PclWriter.
Constructors
| Signature | Description |
|---|---|
# PclOptions() |
Properties
| Property | Type | Description |
|---|---|---|
ColorMode { get; set; } | PclColorMode | |
Compression { get; set; } | PclCompression | |
Dpi { get; set; } | int | |
Threshold { get; set; } | byte | Luminance threshold for monochrome conversion. |
PclWriter
PCL 5 / 5c raster writer: one page per bitmap, framed by printer reset (ESC E).
public static class PclWriterPCL 5 / 5c raster writer: one page per bitmap, framed by printer reset (ESC E).
Methods
| Method Signature | Returns | Description |
|---|---|---|
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.
public static class RasterExportConverts a rendered label (black on white) to 1-bit raster formats and printer languages.
Methods
| Method Signature | Returns | Description |
|---|---|---|
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
public enum TiffCompressionValues
| Name | Value | Description |
|---|---|---|
None | 1 | |
CcittGroup3 | 3 | CCITT Group 3 (T.4, one-dimensional Modified Huffman); 1-bit only. |
CcittGroup4 | 4 | CCITT Group 4 (T.6 MMR); 1-bit only, best for labels. |
Lzw | 5 | |
Deflate | 8 | zlib/Deflate (Adobe, tag value 8). |
PackBits | 32773 |
TiffOptions
Options for TiffWriter.
public sealed class TiffOptionsOptions for TiffWriter.
Constructors
| Signature | Description |
|---|---|
# TiffOptions() |
Properties
| Property | Type | Description |
|---|---|---|
Compression { get; set; } | TiffCompression | |
Dpi { get; set; } | int | X/Y resolution written to the file (pixels per inch). |
PixelFormat { get; set; } | TiffPixelFormat | |
Threshold { get; set; } | byte | Luminance threshold for 1-bit conversion. |
TiffPixelFormat
Sample layout of TIFF pages.
public enum TiffPixelFormatSample layout of TIFF pages.
Values
| Name | Value | Description |
|---|---|---|
BlackWhite1 | 0 | 1 bit per pixel, WhiteIsZero (the only format allowed with CCITT compression). |
Gray8 | 1 | 8-bit grayscale, BlackIsZero. |
Rgb24 | 2 | 8-bit RGB. |
Rgba32 | 3 | 8-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),…
public static class TiffWriterBaseline 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 Signature | Returns | Description |
|---|---|---|
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,…
public static class VectorExportEPS, 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 Signature | Returns | Description |
|---|---|---|
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") | string | HTML 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) | string | SVG of one label; physical size from dpi, vector rectangles in dot units. |
static # ToSvgImage(SKBitmap bitmap, int dpi = 203) | string | SVG 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 typesStructured 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.
public enum BarcodeRedactionWhat happens to barcodes whose data contains redacted information.
Values
CarrierField
One field of a structured carrier message.
public record CarrierFieldOne field of a structured carrier message.
Constructors
| Signature | Description |
|---|---|
# 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
| Property | Type | Description |
|---|---|---|
DataIdentifier { get; init; } | string | ANSI MH10.8.2 data identifier for format 06 fields (e.g. "12Z"). |
Name { get; init; } | string | Field name (camelCase, e.g. "trackingNumber"), or "field{n}" when the position has no known name. |
Value { get; init; } | string | Value as encoded. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# 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…
public sealed class CarrierMessageStructured 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
| Signature | Description |
|---|---|
# CarrierMessage() |
Properties
| Property | Type | Description |
|---|---|---|
Fields { get; init; } | IReadOnlyList<CarrierField> | Fields of all formats in order. |
required Format { get; init; } | string | Format header of the first format, "01" (transportation) or "06" (data identifiers). |
this[string name] { get; } | string | Value of the first field named name, or null. |
Terminated { get; init; } | bool | The message ends with RS EOT. |
Version { get; init; } | string | Two-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.
public enum DateOrderOrder of day and month in numeric dates such as 03/04/2026.
Values
| Name | Value | Description |
|---|---|---|
Auto | 0 | Month first when the label looks US (US address or USPS/UPS/FedEx US data), else day first; ambiguous dates are flagged. |
DayMonthYear | 1 | 03/04/2026 is 3 April 2026. |
MonthDayYear | 2 | 03/04/2026 is 4 March 2026. |
DigitalLinkData
A parsed GS1 Digital Link URI (uncompressed form).
public sealed class DigitalLinkDataA parsed GS1 Digital Link URI (uncompressed form).
Constructors
| Signature | Description |
|---|---|
# DigitalLinkData() |
Properties
| Property | Type | Description |
|---|---|---|
Elements { get; init; } | IReadOnlyList<Gs1ElementInfo> | |
Errors { get; init; } | IReadOnlyList<string> | Syntax violations (empty when valid). |
IsValid { get; } | bool | |
PrimaryKey { get; init; } | string | AI of the primary key in the path (e.g. "01"). |
required Uri { get; init; } | string |
EntitySource
Element an entity was found in.
public record EntitySourceElement an entity was found in.
Constructors
| Signature | Description |
|---|---|
# 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
| Property | Type | Description |
|---|---|---|
Bounds { get; init; } | ExtractBox | Box of that element. |
ElementId { get; init; } | string | Id of the text or barcode ("t3", "b1"). |
Length { get; init; } | int | Length inside the element's text or data. |
Start { get; init; } | int | Start of the entity inside the element's text or data. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# Deconstruct(out string ElementId, out ExtractBox Bounds, out int Start, out int Length) | void |
EntityType
Kind of a recognised entity.
public enum EntityTypeKind of a recognised entity.
Values
| Name | Value | Description |
|---|---|---|
RecipientAddress | 0 | Address block of the recipient (ship to, Empfänger, destinataire …). |
SenderAddress | 1 | Address block of the sender (from, Absender, expéditeur …). |
ReturnAddress | 2 | Return address (return to, Rücksendung an, retour …). |
Address | 3 | Address block whose role could not be told (no keyword, single block). |
PersonName | 4 | A person's name (contact, attention line, name field). |
Phone | 5 | |
Email | 6 | |
TrackingNumber | 7 | Carrier tracking number (UPS 1Z, FedEx, DHL, USPS IMpb, UPU S10 …). |
Carrier | 8 | Carrier of the label (from tracking number formats, structured carrier messages and printed names). |
Sscc | 9 | Serial Shipping Container Code (GS1 AI 00). |
Gtin | 10 | Global Trade Item Number (GS1 AI 01/02, EAN/UPC). |
Batch | 11 | Batch or lot number (GS1 AI 10, LOT, Charge …). |
SerialNumber | 12 | Serial number (GS1 AI 21, S/N …). |
ExpiryDate | 13 | Expiry / use-by date (GS1 AI 17, EXP …). |
BestBeforeDate | 14 | Best-before date (GS1 AI 15, MHD …). |
ProductionDate | 15 | Production date (GS1 AI 11). |
PackagingDate | 16 | Packaging date (GS1 AI 13). |
Date | 17 | Other date (ship date, Datum …). |
Weight | 18 | Weight (kg, lb …; GS1 AI 310n/320n/330n/340n). |
Amount | 19 | Money amount (declared value, COD). |
PackageCount | 20 | Package n of m (1/1, 2 von 3 …). |
OrderNumber | 21 | Order / purchase order number (Order, Bestellung, commande … ; GS1 AI 400). |
Reference | 22 | Other reference: invoice, customer, account, shipment reference, company internal GS1 AIs 90–99. |
RoutingCode | 23 | Postal 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.
public record ExtractBoxAxis-aligned box in printer dots with the same box in mm.
Constructors
| Signature | Description |
|---|---|
# 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
| Property | Type | Description |
|---|---|---|
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 Signature | Returns | Description |
|---|---|---|
# 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.
public sealed class ExtractOptionsSettings of ZplExtract.Run.
Constructors
| Signature | Description |
|---|---|
# ExtractOptions() |
Properties
| Property | Type | Description |
|---|---|---|
DateOrder { get; set; } | DateOrder | How numeric dates like 03/04/2026 are read (default DateOrder.Auto). |
DefaultLabelHeightMm { get; set; } | double | Label height in mm used when the ZPL has no ^LL (default 6 in). |
DefaultLabelWidthMm { get; set; } | double | Label width in mm used when the ZPL has no ^PW (default 4 in). |
Dpi { get; set; } | int | Print 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; } | double | Entities below this confidence are dropped (default 0.3). |
ExtractResult
Result of ZplExtract.Run: one entry per rendered label.
public sealed class ExtractResultResult of ZplExtract.Run: one entry per rendered label.
Constructors
| Signature | Description |
|---|---|
# ExtractResult() |
Properties
| Property | Type | Description |
|---|---|---|
Dpi { get; init; } | int | Resolution the millimetre values were computed with. |
Label { get; } | ExtractedLabel | The first label (null when the input prints none). |
Labels { get; init; } | IReadOnlyList<ExtractedLabel> | |
Notice { get; init; } | string | Reminder that the result is a rule-based guess. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
static # FromJson(string json) | ExtractResult | Parses JSON written by ExtractResult.ToJson. |
# ToJson(bool indented = true) | string | The result as JSON (camelCase, enums as strings, nulls omitted; control characters escaped). |
# ToText() | string | Human 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).
public sealed class ExtractedBarcodeA barcode with the data a scanner would read (encoder side, from the ZPL; not decoded from the image).
Constructors
| Signature | Description |
|---|---|
# ExtractedBarcode() |
Properties
| Property | Type | Description |
|---|---|---|
required Bounds { get; init; } | ExtractBox | |
CarrierMessage { get; init; } | CarrierMessage | Structured carrier message found in a PDF417 / Data Matrix / QR / Aztec symbol. |
required Command { get; init; } | string | Barcode command, e.g. "^BC". |
required Data { get; init; } | string | Data 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). |
DigitalLink { get; init; } | DigitalLinkData | |
FieldNumber { get; init; } | int? | |
Gs1 { get; init; } | Gs1Data | |
required Id { get; init; } | string | Id within the label ("b1", "b2" …). |
IsGs1 { get; init; } | bool | FNC1 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).
public sealed class ExtractedGraphicAn image on the label. Its content is not inspected (text inside images is not extracted).
Constructors
| Signature | Description |
|---|---|
# ExtractedGraphic() |
Properties
| Property | Type | Description |
|---|---|---|
required Bounds { get; init; } | ExtractBox | |
required Command { get; init; } | string | ^GF, ^XG or ^IM. |
required Id { get; init; } | string | Id within the label ("g1" …). |
Source { get; init; } | SourceSpan |
ExtractedLabel
Extraction result of one rendered label.
public sealed class ExtractedLabelExtraction result of one rendered label.
Constructors
| Signature | Description |
|---|---|
# ExtractedLabel() |
Properties
| Property | Type | Description |
|---|---|---|
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; } | int | 0-based index in print order. |
Recipient { get; } | LabelEntity | The recipient address block (or the only unassigned address block), or null. |
Rfid { get; init; } | IReadOnlyList<ExtractedRfid> | |
Sender { get; } | LabelEntity | The sender address block, or null. |
Texts { get; init; } | IReadOnlyList<ExtractedText> | |
Width { get; init; } | int | |
WidthMm { get; init; } | double |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# Best(EntityType type) | LabelEntity | The 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 …).
public sealed class ExtractedRfidData written to an RFID tag (^RF write, ^WT …).
Constructors
| Signature | Description |
|---|---|
# ExtractedRfid() |
Properties
| Property | Type | Description |
|---|---|---|
required Command { get; init; } | string | |
required Data { get; init; } | string | Data after ^FH decoding. |
Source { get; init; } | SourceSpan |
ExtractedText
A text field as drawn (all ^FH / ^CI / ^FN / ^XF / ^SN processing applied).
public sealed class ExtractedTextA text field as drawn (all ^FH / ^CI / ^FN / ^XF / ^SN processing applied).
Constructors
| Signature | Description |
|---|---|
# ExtractedText() |
Properties
| Property | Type | Description |
|---|---|---|
required Bounds { get; init; } | ExtractBox | Box 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; } | string | Font as requested (0, A … or the ^A@ file name). |
FontHeight { get; init; } | int | Character cell height in dots (^A / ^CF height, 0 = font default). |
required Id { get; init; } | string | Id within the label ("t1", "t2" … in drawing order). |
Orientation { get; init; } | string | N, R, I or B. |
Reverse { get; init; } | bool | White on black (^FR / ^LR). |
Role { get; set; } | TextRole | |
RoleConfidence { get; set; } | double | Confidence of ExtractedText.Role (0–1). |
Source { get; init; } | SourceSpan | |
required Text { get; init; } | string | Text as printed; ^FB line breaks (\&) become "\n". |
Gs1Data
Parsed GS1 element strings of a barcode or Digital Link URI.
public sealed class Gs1DataParsed GS1 element strings of a barcode or Digital Link URI.
Constructors
| Signature | Description |
|---|---|
# Gs1Data() |
Properties
| Property | Type | Description |
|---|---|---|
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.
public record Gs1ElementInfoOne GS1 element string of a barcode.
Constructors
| Signature | Description |
|---|---|
# 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
| Property | Type | Description |
|---|---|---|
Ai { get; init; } | string | Application identifier, e.g. "00". |
Error { get; init; } | string | Why it is invalid (null when valid). |
Interpreted { get; init; } | string | Decoded value where the AI defines one: ISO date for YYMMDD, decimal value for n-decimal AIs. |
Title { get; init; } | string | GS1 data title, e.g. "SSCC" (null for AIs without a known title). |
Valid { get; init; } | bool | The value passes the GS1 syntax, length and check digit rules. |
Value { get; init; } | string | Value as encoded. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# 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.
public sealed class LabelEntityA recognised piece of information with confidence, sources and evidence.
Constructors
| Signature | Description |
|---|---|
# LabelEntity() |
Properties
| Property | Type | Description |
|---|---|---|
Bounds { get; set; } | ExtractBox | Union of the source boxes. |
Carrier { get; init; } | string | Carrier 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; } | double | Rule-based confidence 0–1 (not a probability). |
required Evidence { get; set; } | string | Why the entity was recognised: keyword, pattern, GS1 AI, check digit, layout. |
Normalized { get; init; } | string | Normalised 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; } | string | Value as printed or encoded (address blocks: the lines joined with "\n"). |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# ToString() | string |
MaxiCodeData
MaxiCode content: mode, primary message (postal code, country, service class) and the carrier message.
public sealed class MaxiCodeDataMaxiCode content: mode, primary message (postal code, country, service class) and the carrier message.
Constructors
| Signature | Description |
|---|---|
# MaxiCodeData() |
Properties
| Property | Type | Description |
|---|---|---|
Country { get; init; } | string | ISO 3166 alpha-2 of MaxiCodeData.CountryCode when known (e.g. "US"). |
CountryCode { get; init; } | string | Mode 2/3: ISO 3166 numeric country code (e.g. "840"). |
Message { get; init; } | CarrierMessage | Secondary message as structured carrier message, when present. |
Mode { get; init; } | int | MaxiCode mode (2 = numeric postal code, 3 = alphanumeric, 4–6 = no structured primary message). |
PostalCode { get; init; } | string | Mode 2/3: postal code of the ship-to address (mode 2: 5-digit ZIP + 4-digit ZIP+4). |
ServiceClass { get; init; } | string | Mode 2/3: 3-digit class of service. |
RedactCategories
What ZplRedact removes, combinable as flags.
public enum RedactCategoriesWhat ZplRedact removes, combinable as flags.
Values [Flags]
| Name | Value | Description |
|---|---|---|
None | 0 | |
Names | 0x1 | Person and company names: name lines of address blocks, contacts, attention lines, name fields. |
Addresses | 0x2 | Street, building, postal code and city lines; postal routing data (Leitcode, GS1 AI 403/420/421, POSTNET/IMb ZIP, MaxiCode postal code). |
Phone | 0x4 | |
Email | 0x8 | |
TrackingNumbers | 0x10 | Tracking numbers and SSCCs: they let anyone look up the shipment and its delivery address. |
References | 0x20 | Order, invoice, customer, account and shipment reference numbers; GS1 AIs 400 and 90–99. |
Comments | 0x40 | All ^FX comments and text outside of commands (the printer ignores it, but it travels with the file). |
UnclassifiedText | 0x80 | Text 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. |
Rfid | 0x100 | Data written to RFID tags (^RF, ^WT …). |
Graphics | 0x200 | Images (^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. |
PersonalData | 0xF | Names, addresses, phone numbers and e-mail addresses. |
Default | 0x1FF | The default: personal data, tracking numbers, references, comments, unclassified text and RFID data (images are reported, not blanked). |
All | 0x3FF | Everything including images. |
RedactMode
How redacted text is written.
public enum RedactModeHow redacted text is written.
Values
| Name | Value | Description |
|---|---|---|
Mask | 0 | Letters become X / x, digits 0; spaces and simple separators stay (same length, same layout). |
Replace | 1 | Placeholder words of the same length per category (NAME, STREET, CITY …, digits 1234…). |
Remove | 2 | The redacted text is deleted (fields stay, but print shorter or empty; barcodes are removed). |
RedactOptions
Settings of ZplRedact.Run.
public sealed class RedactOptionsSettings of ZplRedact.Run.
Constructors
| Signature | Description |
|---|---|
# RedactOptions() |
Properties
| Property | Type | Description |
|---|---|---|
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; } | RedactCategories | Categories to redact (default RedactCategories.Default, conservative). |
Dpi { get; set; } | int | Resolution used to render the label for the analysis (default 203). |
KeepStructure { get; set; } | bool | Keep 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; } | bool | Re-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.
public sealed class RedactResultResult of ZplRedact.Run.
Constructors
| Signature | Description |
|---|---|
# RedactResult() |
Properties
| Property | Type | Description |
|---|---|---|
required Report { get; init; } | RedactionReport | |
required Zpl { get; init; } | string | The redacted ZPL. |
RedactionAction
One redaction (never contains the original value).
public record RedactionActionOne redaction (never contains the original value).
Constructors
| Signature | Description |
|---|---|
# RedactionAction() |
Properties
| Property | Type | Description |
|---|---|---|
Category { get; init; } | RedactCategories | |
Characters { get; init; } | int | Number of characters replaced or removed. |
Column { get; init; } | int | |
Command { get; init; } | string | Command 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; } | int | Label index (-1 when not tied to a rendered label). |
Line { get; init; } | int | |
Offset { get; init; } | int | Offset of the command in the original ZPL. |
Target { get; init; } | RedactionTarget |
RedactionReport
Redaction report: actions, warnings and the verification result (no original values).
public sealed class RedactionReportRedaction report: actions, warnings and the verification result (no original values).
Constructors
| Signature | Description |
|---|---|
# RedactionReport() |
Properties
| Property | Type | Description |
|---|---|---|
Actions { get; init; } | IReadOnlyList<RedactionAction> | |
Categories { get; init; } | RedactCategories | |
KeepStructure { get; init; } | bool | |
LabelCount { get; init; } | int | |
Mode { get; init; } | RedactMode | |
RemainingMatches { get; init; } | int | Redacted values still found in the output after the second pass (0 is the expected result). |
SearchedValues { get; init; } | int | Number 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; } | bool | The output was re-scanned (RedactOptions.Verify). |
Warnings { get; init; } | IReadOnlyList<RedactionWarning> |
Methods
RedactionTarget
What was redacted.
public enum RedactionTargetWhat was redacted.
Values
| Name | Value | Description |
|---|---|---|
Text | 0 | A text field (^FD / ^FV). |
Barcode | 1 | |
Comment | 2 | A ^FX comment. |
StrayText | 3 | Text outside of any command. |
StoredFormat | 4 | A field default inside a stored format (^DF). |
FieldNumberData | 5 | Field data of a ^XF recall (^FN n ^FD …). |
Serial | 6 | A ^SN serialization start value. |
Rfid | 7 | |
Graphic | 8 | An image that was blanked. |
Occurrence | 9 | A ^FN prompt or another occurrence found by the search for redacted values. |
RedactionWarning
Something the redaction could not handle or the caller should check.
public record RedactionWarningSomething the redaction could not handle or the caller should check.
Constructors
| Signature | Description |
|---|---|
# 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
| Property | Type | Description |
|---|---|---|
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 Signature | Returns | Description |
|---|---|---|
# 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.
public record SourceSpanWhere an element comes from in the ZPL source.
Constructors
| Signature | Description |
|---|---|
# 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
| Property | Type | Description |
|---|---|---|
Column { get; init; } | int | 1-based column (0 when unknown). |
Length { get; init; } | int | Length of the field block up to and including ^FS. |
Line { get; init; } | int | 1-based line (0 when unknown). |
Offset { get; init; } | int | Character offset of the field's first command (-1 when unknown). |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# Deconstruct(out int Offset, out int Length, out int Line, out int Column) | void |
TextRole
Role guess of a text field.
public enum TextRoleRole guess of a text field.
Values
| Name | Value | Description |
|---|---|---|
Other | 0 | |
Caption | 1 | Static caption or heading (SHIP TO, Gewicht:, TRACKING NUMBER …). |
Name | 2 | Name line of an address block or contact. |
Company | 3 | Company line of an address block. |
AddressLine | 4 | Street, building, floor … of an address block. |
PostalCity | 5 | Postal code and city. |
Country | 6 | |
Phone | 7 | |
Email | 8 | |
TrackingNumber | 9 | |
Reference | 10 | Order, invoice, customer or other reference. |
Date | 11 | |
Weight | 12 | |
Amount | 13 | |
PackageCount | 14 | |
BarcodeText | 15 | Human readable text of a barcode printed as separate field (same data). |
Carrier | 16 | Carrier name or logo text. |
Service | 17 | Service level (EXPRESS, GROUND, PRIORITY …). |
Routing | 18 | Routing code (Leitcode, ZIP routing). |
ProductData | 19 | Product 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 …
public static class ZplExtractLabel 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 Signature | Returns | Description |
|---|---|---|
static # Run(string zpl, ExtractOptions? options = default) | ExtractResult | Extracts texts, barcodes and entities from every label the ZPL prints. |
static # Run(byte[] zpl, ExtractOptions? options = default) | ExtractResult | Extracts 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…
public static class ZplRedactRedaction 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 Signature | Returns | Description |
|---|---|---|
static # Run(string zpl, RedactOptions? options = default) | RedactResult | Redacts zpl; see RedactOptions for categories and modes. |
static # Run(byte[] zpl, RedactOptions? options = default) | RedactResult | Redacts raw ZPL bytes (decoded like the renderer: UTF-8 when valid, else code page 850). |
ZplCore.Graphics #
10 typesMonochrome 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.
public enum DitherModeConversion of colour/gray images to 1 bit.
Values
| Name | Value | Description |
|---|---|---|
Threshold | 0 | Fixed luminance threshold. |
FloydSteinberg | 1 | |
Atkinson | 2 | |
Bayer | 3 | Ordered dithering with an 8×8 Bayer matrix. |
Otsu | 4 | Threshold 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…
public static class GifWriterMinimal 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 Signature | Returns | Description |
|---|---|---|
static # Encode(SKBitmap bitmap) | byte[] |
GraphicCompression
Data encoding of generated ^GF graphics.
public enum GraphicCompressionData encoding of generated ^GF graphics.
Values
ImageMetadata
Writes resolution (DPI) metadata into encoded PNG (pHYs chunk) and JPEG (JFIF APP0 density) files.
public static class ImageMetadataWrites resolution (DPI) metadata into encoded PNG (pHYs chunk) and JPEG (JFIF APP0 density) files.
Methods
| Method Signature | Returns | Description |
|---|---|---|
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.
public sealed class MonoBitmapA stored 1-bit graphic (~DG, ~DY, ^GF) — 1 = black, MSB first.
Constructors
| Signature | Description |
|---|---|
# MonoBitmap(byte[] bits, int bytesPerRow, int height) |
Properties
| Property | Type | Description |
|---|---|---|
Bits { get; } | byte[] | |
BytesPerRow { get; } | int | |
Height { get; } | int | |
Width { get; } | int |
Methods
| Method Signature | Returns | Description |
|---|---|---|
static # FromBitmap(SKBitmap source, byte threshold = 128, bool dither = false) | MonoBitmap | Converts 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.
public static class PcxDecoderMinimal PCX reader (RLE, 1 bpp monochrome or 8 bpp palette/grayscale) for EPL GM graphics.
Methods
| Method Signature | Returns | Description |
|---|---|---|
static # Decode(byte[] pcx) | MonoBitmap | Decodes a PCX file to a 1-bit graphic (dark pixels = black). |
PngCompression
Compression/speed trade-off for PNG output.
public enum PngCompressionCompression/speed trade-off for PNG output.
Values
| Name | Value | Description |
|---|---|---|
Fastest | 0 | zlib level 1 – fastest, ~2× larger files. |
Optimal | 1 | zlib level 6 – good balance (default). |
SmallestSize | 2 | zlib 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…
public static class PngWriterFast 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 Signature | Returns | Description |
|---|---|---|
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…
public static class ZplGraphicDecoderDecodes 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 Signature | Returns | Description |
|---|---|---|
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) | string | Encodes a 1bpp buffer as uncompressed ASCII hex (for ^GFA output). |
static # EncodeZ64(byte[] data) | string | Encodes a 1bpp buffer as :Z64: with CRC16 (CCITT, as used by Zebra). |
ZplGraphicEncoder
Image → ZPL graphic conversion with selectable dithering and ^GF data compression.
public static class ZplGraphicEncoderImage → ZPL graphic conversion with selectable dithering and ^GF data compression.
Methods
| Method Signature | Returns | Description |
|---|---|---|
static # EncodeData(MonoBitmap mono, GraphicCompression compression) | string | The ^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) | MonoBitmap | Converts 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) | string | Complete label ^XA^FOx,y^GFA…^FS^XZ printing the image. |
ZplCore.Labels #
54 typesDeclarative label object model (mm/inch/dots), expressions, tables, repeaters, multi-page duplex labels, bulk data binding (For<T>), print jobs, and ZPL import.
BarcodeItem
public sealed class BarcodeItem : LabelItemConstructors
| Signature | Description |
|---|---|
# BarcodeItem() |
Properties
| Property | Type | Description |
|---|---|---|
AddChecksum { get; set; } | bool | |
BackColor { get; set; } | string | Background colour as hex (#RRGGBB); a dark background prints the code inverted. |
BarHeight { get; set; } | double | Bar height in label units (1D) or module size in dots (QR/DataMatrix/Aztec). |
BearerBarWidth { get; set; } | double | Bearer bar thickness in dots. |
BearerBars { get; set; } | BearerBarStyle | |
Code { get; set; } | string | |
Code128Mode { get; set; } | Code128Mode | Code 128 mode (^BC m, native only; Symbology.Gs1_128 always uses mode D). |
CodeEncoding { get; set; } | CodeEncoding | How 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; } | string | Bar colour as hex (#RRGGBB); dark colours print black, light ones white. |
GuardBars { get; set; } | bool | Extend EAN/UPC guard bars into the text. |
HumanReadable { get; set; } | bool | |
HumanReadableAbove { get; set; } | bool | |
HumanReadableText { get; set; } | string | Text instead of the encoded data. |
IsGeneratorOnly { get; } | bool | Symbologies without a ZPL barcode command. |
LightMarginIndicator { get; set; } | bool | EAN/UPC light margin indicators ('<' '>'). |
MaxiCodeMode { get; set; } | int | MaxiCode mode 2–6 (^BD). |
ModuleShape { get; set; } | ModuleShape | |
ModuleWidth { get; set; } | int | Narrow bar / module width in dots (^BY w). |
Options { get; set; } | BarcodeItemOptions | Further 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; } | int | PDF417 data columns 1–30 (0 = automatic, ^B7 c). |
Pdf417RowHeight { get; set; } | int | PDF417 row height in dots (^B7 h; 0 = 3 × BarcodeItem.ModuleWidth). |
Pdf417Rows { get; set; } | int | PDF417 rows 3–90 (0 = automatic, ^B7 r; native only). |
Pdf417SecurityLevel { get; set; } | int | PDF417 security level 0–8 (^B7 s). |
ProcessTilde { get; set; } | bool | Tilde escapes (~1 FNC1, ~dNNN …) in BarcodeItem.Code. |
QrErrorCorrection { get; set; } | char | QR error correction: L, M, Q, H. |
QrMask { get; set; } | int | QR mask 0–7 (-1 = automatic). |
QrVersion { get; set; } | int | QR 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; } | string | EAN/UPC 2/5-digit add-on. |
Symbology { get; set; } | Symbology | |
TextAlignment { get; set; } | HumanReadableAlignment | |
TextFontSize { get; set; } | double | Human readable font size in points (0 = automatic). |
TextFormatPattern { get; set; } | string | Format/mask of the human readable text, e.g. "{0:### ###}" or "AAA-999". |
WideRatio { get; set; } | double | Wide-to-narrow ratio for Code 39, I2of5, Codabar ... (2.0–3.0). |
Methods
| Method Signature | Returns | Description |
|---|---|---|
static # ToGenerator(Symbology s) | Symbology | Generator 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…
public record BarcodeItemOptionsBarcode 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
| Signature | Description |
|---|---|
# BarcodeItemOptions() |
Properties
| Property | Type | Description |
|---|---|---|
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; } | string | Border 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; } | string | Data 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).
public static class CheckDigitsCheck digit helpers used by the expression engine (Mod10, Luhn, Mod11, Mod43, VoicePickCode).
Methods
| Method Signature | Returns | Description |
|---|---|---|
static # Luhn(string digits) | string | Luhn (ISO/IEC 7812) check digit. Non-digits are ignored. |
static # Mod10(string digits) | string | GS1 / UPC modulo 10 check digit (weights 3,1,3,… from the right). Non-digits are ignored. |
static # Mod11(string digits) | string | Modulo 11 check digit with weights 2..7 cycling from the right; remainder 0 → "0", 1 → "X". |
static # Mod43(string data) | string | Code 39 modulo 43 check character. |
static # VoicePickCode(string gtin, string lot, string? date = default) | string | Produce 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
public sealed class CircleItem : LabelItemConstructors
| Signature | Description |
|---|---|
# CircleItem() |
Properties
| Property | Type | Description |
|---|---|---|
Diameter { get; set; } | double | |
Fill { get; set; } | ItemColor | |
StrokeStyle { get; set; } | StrokeStyle | |
StrokeThickness { get; set; } | double |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# ToZpl(ZplContext ctx) | string |
Code128Mode
Code 128 mode of a native Symbology.Code128 item (^BC m parameter).
public enum Code128ModeCode 128 mode of a native Symbology.Code128 item (^BC m parameter).
Values
| Name | Value | Description |
|---|---|---|
Automatic | 0 | Automatic subset selection (^BC m = A, the default of the label model). |
None | 1 | No mode (^BC m = N, the ZPL default): subsets and FNC codes come from invocation codes (>; >: >8 …) in the data. |
Ucc | 2 | UCC case mode (^BC m = U): 19 digits padded and check digit added. |
Gs1 | 3 | GS1-128 (^BC m = D), same as Symbology.Gs1_128. |
CornerRadius
public sealed class CornerRadiusConstructors
Properties
| Property | Type | Description |
|---|---|---|
BottomLeft { get; set; } | double | |
BottomRight { get; set; } | double | |
TopLeft { get; set; } | double | |
TopRight { get; set; } | double |
DitherMethod
Conversion of grey levels to black/white.
public enum DitherMethodConversion of grey levels to black/white.
Values
| Name | Value | Description |
|---|---|---|
Threshold | 0 | Fixed ImageItem.Threshold. |
FloydSteinberg | 1 | |
Atkinson | 2 | |
Bayer | 3 | Ordered 8×8 Bayer matrix. |
Otsu | 4 | Automatic threshold (Otsu's method). |
DpiSource
Where the import resolution came from.
public enum DpiSourceWhere the import resolution came from.
Values
| Name | Value | Description |
|---|---|---|
Options | 0 | ImportOptions.Dpi. |
UnitCommand | 1 | ^MU base resolution (^MUd,o,c). |
LabelSize | 2 | Label width (^PW) or the extent of the fields. |
Default | 3 | Nothing hints at a resolution: 203 dpi. |
EllipseItem
public sealed class EllipseItem : LabelItemConstructors
| Signature | Description |
|---|---|
# EllipseItem() |
Properties
| Property | Type | Description |
|---|---|---|
Fill { get; set; } | ItemColor | |
Height { get; set; } | double | |
StrokeStyle { get; set; } | StrokeStyle | |
StrokeThickness { get; set; } | double | |
Width { get; set; } | double |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# ToZpl(ZplContext ctx) | string |
ExpressionEngine
Small expression language for label items, e.g. Upper([Name]) + " / " + Format(Now(), "dd.MM.yyyy") or If([…
public sealed class ExpressionEngineSmall 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.
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
| Signature | Description |
|---|---|
# ExpressionEngine() |
Properties
| Property | Type | Description |
|---|---|---|
Clock { get; set; } | Func<DateTime> | Clock for Now()/Today() (tests, reprints with the original date). |
Culture { get; set; } | CultureInfo | Culture 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 Signature | Returns | Description |
|---|---|---|
# AddTypeReference<TRef>(string? alias = default) | ExpressionEngine | |
# AddTypeReference(Type type, string? alias = default) | ExpressionEngine | Allows 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) | string | Evaluates to a display string. |
static # Num(object v) | double | Culture-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) | ExpressionEngine | Adds or replaces a function callable as Name(args). |
# SetCustomVariable(string name, object value) | ExpressionEngine | Adds or replaces a variable usable by name in expressions. |
static # Str(object v) | string | Culture-invariant text conversion (use ExpressionEngine.ToText for the engine's ExpressionEngine.Culture). |
static # Str(object v, IFormatProvider culture) | string | |
# ToNum(object v) | double | Converts a value to a number with ExpressionEngine.Culture (falls back to invariant parsing). |
# ToText(object v) | string | Converts a value to text with ExpressionEngine.Culture. |
FontUnit
Unit of a font size (TextItem.FontSize).
public enum FontUnitUnit of a font size (TextItem.FontSize).
Values
| Name | Value | Description |
|---|---|---|
Point | 0 | |
Pixel | 1 | Printer dots (pixels). |
Millimeter | 2 | |
Inch | 3 |
FrameThickness
Per-corner radius of a rectangle (label units).
public sealed class FrameThicknessPer-corner radius of a rectangle (label units).
Constructors
Properties
ITextMeasurer
Unit conversion and data context for ZPL generation.
public interface ITextMeasurerUnit conversion and data context for ZPL generation.
Methods
| Method Signature | Returns | Description |
|---|---|---|
# Lines(string fontId, int height, int width, string text, int blockWidth) | int | Number of lines the text needs in a block of the given width (dots). |
ImageAspectRatio
How an image keeps its aspect ratio when sized.
public enum ImageAspectRatioHow an image keeps its aspect ratio when sized.
Values
| Name | Value | Description |
|---|---|---|
None | 0 | Missing dimension follows the aspect ratio; both given = stretched. |
Width | 1 | Height follows ImageItem.Width. |
Height | 2 | Width follows ImageItem.Height. |
Fit | 3 | Largest size inside Width × Height. |
ImageItem
Image converted to a 1-bit ^GFA graphic (Z64 compressed) or stored on the printer (~DG + ^XG).
public sealed class ImageItem : LabelItemImage converted to a 1-bit ^GFA graphic (Z64 compressed) or stored on the printer (~DG + ^XG).
Constructors
| Signature | Description |
|---|---|
# ImageItem() |
Properties
| Property | Type | Description |
|---|---|---|
Dither { get; set; } | bool | Legacy: Floyd–Steinberg dithering (same as ImageItem.DitherMethod = FloydSteinberg). |
DitherMethod { get; set; } | DitherMethod | |
Flip { get; set; } | ImageFlip | |
Height { get; set; } | double? | |
HideIfNotFound { get; set; } | bool | Emit 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; } | bool | Invert 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; } | string | Image file loaded when generating (used when ImageItem.ImageData is empty). |
StorageName { get; set; } | string | Printer name for ImageItem.UsePrinterStorage, e.g. "R:LOGO.GRF" (null = derived from the content). |
Threshold { get; set; } | byte | |
UsePrinterStorage { get; set; } | bool | Download 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 Signature | Returns | Description |
|---|---|---|
# ToZpl(ZplContext ctx) | string |
ImportFallback
What Label.FromZpl does with a field the label model cannot express exactly.
public enum ImportFallbackWhat Label.FromZpl does with a field the label model cannot express exactly.
Values
| Name | Value | Description |
|---|---|---|
RawZpl | 0 | Keep the field as an exact, self-contained RawZplItem (prints identically, not editable as a typed item). |
Approximate | 1 | Use the closest typed item anyway (editable, may print slightly differently; reported as LabelImportWarningKind.Approximated). |
ImportOptions
Options of Label.FromZpl.
public sealed class ImportOptionsOptions of Label.FromZpl.
Constructors
| Signature | Description |
|---|---|
# ImportOptions() |
Properties
| Property | Type | Description |
|---|---|---|
CompareTolerance { get; set; } | int | Pixel 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; } | bool | Field 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; } | ImportFallback | Handling 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; } | bool | Keep PNG renders of the original, the re-exported label and their diff in ImportedLabel. |
MeasureFidelity { get; set; } | bool | Render the re-exported label and compare it with the original (fills ImportedLabel.Fidelity). |
Unit { get; set; } | LabelUnit | Unit of the imported labels (positions and sizes). LabelUnit.Dots keeps the exact ZPL values. |
UseSystemFonts { get; set; } | bool | Use installed system fonts for unknown ^A@ fonts (as in ZplRenderSettings.UseSystemFonts). |
ImportedLabel
One imported format.
public sealed class ImportedLabelOne imported format.
Constructors
| Signature | Description |
|---|---|
# ImportedLabel() |
Properties
| Property | Type | Description |
|---|---|---|
Comparison { get; init; } | ImageComparison | Pixel 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; } | string | Name of the stored format this label defines (^DF) or recalls (^XF). |
Index { get; init; } | int | Index in LabelImportResult.Labels. |
IsTemplate { get; init; } | bool | True for a stored format (^DF) imported as template; its unbound fields show their ^FN number as sample text. |
required Label { get; init; } | Label | The 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; } | bool | True when the re-exported label renders pixel-identical to the original. |
RawItems { get; init; } | int | Items kept as RawZplItem. |
RoundTripPng { get; init; } | byte[] | PNG of the re-exported label (ImportOptions.IncludeImages). |
SourceOffset { get; init; } | int | Character offset of the format in the source (-1 = unknown). |
TypedItems { get; init; } | int | Items 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.
ItemPadding
Spacing inside an item's box (label units).
ItemRotation
Label
Label designer object model: describe a label with items in physical units, then generate ZPL (Label.ToZpl), render a preview t…
public sealed class LabelLabel 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
Properties
| Property | Type | Description |
|---|---|---|
Culture { get; set; } | string | Culture used to resolve {t:key} placeholders (e.g. "de-DE"; null = current UI culture). |
CutAfterPrinting { get; set; } | bool | Cut after each label (^MMC). |
Darkness { get; set; } | int? | 0–30 (^MD relative darkness is -30..30, ~SD absolute 0..30). |
DownloadFonts { get; set; } | bool | Send Label.Fonts to the printer (disable if they are already stored there). |
Duplex { get; set; } | bool | Duplex 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; } | ExpressionEngine | Expression engine for item expressions (add custom functions/variables here). |
FontAsGraphicThreshold { get; set; } | int | Fonts 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; } | double | Gap 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; } | ZplOptimization | Optimisation 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; } | bool | Rotate the whole label by 180° (^PO I). |
PrintMirror { get; set; } | bool | Mirror the label (^PM Y). |
PrintSpeed { get; set; } | int? | Print speed in inches per second (^PR). |
SchemaVersion { get; set; } | int | Schema 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
| Field | Type | Description |
|---|---|---|
const CurrentSchemaVersion = 3 | int | Version of the JSON template schema written by this library. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# Add(LabelItem item) | Label | |
# AddFont(string name, byte[] ttf) | Label | |
# AddFontFile(string path, string? name = default) | Label | |
# AddPage(string? name = default) | LabelPage | Adds a page (page 2 = back side on duplex printers) and returns it. |
# AddString(string culture, string key, string text) | Label | Adds a localized string. |
# Clone() | Label | |
# ConvertToUnit(LabelUnit unit, int dpi = 203) | Label | Converts the label size and every item without own LabelItem.Unit to unit. |
# FontDownloadZpl(FontDownloadCommand command = FontDownloadCommand.DY) | string | Only 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) | Label | Loads a JSON template of any schema version (older versions are migrated). |
static # FromZpl(string zpl, ImportOptions? options = default) | LabelImportResult | Imports 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) | string | Replaces {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") | string | HTML page with the rendered label(s) embedded as PNG (for previews, e-mails, web views). |
# ToJson() | string | |
# ToZpl(int dpi = 203, int copies = 1) | string | Generates ZPL for one label (no data binding). |
# ToZpl(IEnumerable<IReadOnlyDictionary<string, object>> records, int dpi = 203, int copiesPerRecord = 1) | string | One label per dictionary record (keys = LabelItem.DataField names). |
# ToZpl<T>(IEnumerable<T> data, int dpi = 203, int copiesPerRecord = 1) | string | One label per object; data fields are property paths like "Customer.Address.City". |
# ToZplAt(int index, int dpi = 203) | string | ZPL 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…
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.
Methods
| Method Signature | Returns | Description |
|---|---|---|
# 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) | string | Generates 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) | void | Streams ZPL for all records to a writer (file, network stream ...). |
# WriteZplAsync(IAsyncEnumerable<T> records, TextWriter writer, int dpi = 203, CancellationToken ct = default) | Task | Streams ZPL from an async source, e.g. EF Core query.AsAsyncEnumerable(). |
# WriteZplAsync(IAsyncEnumerable<T> records, TextWriter writer, int dpi, int? recordCount, CancellationToken ct = default) | Task | Streams 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) | Task | Writes 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) | Task | Writes 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) | Task | Writes 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) | Task | Sync-source variant of the PipeWriter overload. |
LabelImportResult
Result of Label.FromZpl.
public sealed class LabelImportResultResult of Label.FromZpl.
Constructors
| Signature | Description |
|---|---|
# LabelImportResult() |
Properties
| Property | Type | Description |
|---|---|---|
Dpi { get; init; } | int | Resolution used for the import (and for Label.ToZpl(dpi) to reproduce the original). |
DpiSource { get; init; } | DpiSource | |
Fidelity { get; } | double | Lowest round-trip score of all labels (1 when nothing was measured). |
Label { get; } | Label | The 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.
public record LabelImportWarningA message of Label.FromZpl with its source position.
Constructors
| Signature | Description |
|---|---|
# 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
| Property | Type | Description |
|---|---|---|
Column { get; init; } | int | 1-based column (0 = unknown). |
Command { get; init; } | string | ZPL command (e.g. "^TB"), empty for general messages. |
Kind { get; init; } | LabelImportWarningKind | Severity / category. |
LabelIndex { get; init; } | int | Index into LabelImportResult.Labels (-1 = whole document). |
Line { get; init; } | int | 1-based line (0 = unknown). |
Message { get; init; } | string | English description. |
Offset { get; init; } | int | Character offset in the ZPL source (-1 = unknown). |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# 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.
public enum LabelImportWarningKindKind of an import message.
Values
| Name | Value | Description |
|---|---|---|
Info | 0 | Resolved into the model without loss (e.g. ^LH, ^FW, ^CF, ^BY, ^CI defaults applied to every item). |
Ignored | 1 | Printer or media setting the label model does not hold (no effect on the printed image, e.g. ^MN, ^MD). |
KeptAsRawZpl | 2 | Field kept as exact raw ZPL because no typed item prints identically. |
Approximated | 3 | Typed item that prints slightly differently or loses a printer-side behaviour. |
Unsupported | 4 | Command 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).
public abstract class LabelItemBase class for all label items. Positions are in the label's unit (or LabelItem.Unit).
Properties
| Property | Type | Description |
|---|---|---|
DataField { get; set; } | string | Data 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; } | string | Expression 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; } | bool | Render 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; } | bool | Invert the item over what's below it (^FR). |
RotationAngle { get; set; } | double | Rotation 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 Signature | Returns | Description |
|---|---|---|
# Clone() | LabelItem | Deep copy (through the JSON model). |
# ConvertToUnit(LabelUnit unit, LabelUnit labelUnit = LabelUnit.Mm, int dpi = 203) | LabelItem | Converts 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.
public sealed class LabelPageOne page of a multi-page (e.g. duplex front/back) label.
Constructors
| Signature | Description |
|---|---|
# LabelPage() |
Properties
Methods
LabelSchema
Migrations of the label JSON template between schema versions. Version 1 = templates without "schemaVersion"; version…
public static class LabelSchemaMigrations 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 Signature | Returns | Description |
|---|---|---|
static # Migrate(JsonObject label) | int | Upgrades 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…
public sealed class LabelSheetSheet 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
| Signature | Description |
|---|---|
# LabelSheet() |
Properties
| Property | Type | Description |
|---|---|---|
Columns { get; set; } | int | |
HorizontalGap { get; set; } | double | |
Label { get; set; } | Label | Optional 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; } | int | 1-based position of the first label on the first sheet (reuse partially used sheets). |
Unit { get; set; } | LabelUnit | |
VerticalGap { get; set; } | double |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# 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) | string | ZPL 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) | string | Wide media ZPL for unbound labels: one row of LabelSheet.Columns labels per format. |
LabelSheetOrder
public enum LabelSheetOrderValues
| Name | Value | Description |
|---|---|---|
RowWise | 0 | Left to right, then next row. |
ColumnWise | 1 | Top to bottom, then next column. |
LineItem
public sealed class LineItem : LabelItemConstructors
| Signature | Description |
|---|---|
# LineItem() |
Properties
| Property | Type | Description |
|---|---|---|
StrokeStyle { get; set; } | StrokeStyle | |
StrokeThickness { get; set; } | double | |
White { get; set; } | bool | White line (erases). |
X2 { get; set; } | double | |
Y2 { get; set; } | double |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# 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,…
public static class MaskCounterMask 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 Signature | Returns | Description |
|---|---|---|
static # Apply(string value, string mask, string increment, long times) | string | Formats 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) | bool | True when the increment changes the value. |
PrintJobInfo
Data of a print job for leading/trailing labels (bind fields like "JobName", "RecordCount", "FirstKey&…
public record PrintJobInfoData of a print job for leading/trailing labels (bind fields like "JobName", "RecordCount", "FirstKey").
Constructors
| Signature | Description |
|---|---|
# PrintJobInfo(string JobName, DateTime Created) | Data of a print job for leading/trailing labels (bind fields like "JobName", "RecordCount", "FirstKey"). |
Properties
| Property | Type | Description |
|---|---|---|
Created { get; init; } | DateTime | |
FirstKey { get; } | string | |
JobName { get; init; } | string | |
LabelCount { get; } | int | Printed 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 Signature | Returns | Description |
|---|---|---|
# 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…
public sealed class PrintJobTemplateA 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
| Signature | Description |
|---|---|
# PrintJobTemplate() |
Properties
| Property | Type | Description |
|---|---|---|
CopiesField { get; set; } | string | Record member holding the number of copies per record (property path), e.g. "Parcels". |
CutAfterLastLabel { get; set; } | bool | Cut only after the last label (tear-off mode before). |
JobName { get; set; } | string | |
KeyField { get; set; } | string | Record member used as key for PrintJobInfo.FirstKey/PrintJobInfo.LastKey (property path). |
Label { get; set; } | Label | The label printed for every record. |
Leading { get; set; } | Label | Printed first; bound to PrintJobInfo. |
StoredFormatName { get; set; } | string | Store the record label once in printer memory (^DF/^XF) and send only field values. |
Trailing { get; set; } | Label | Printed last; bound to PrintJobInfo (counts, first/last key). |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# For<T>() | LabelBinding<T> | Creates the configured data binding for records of type T. |
static # FromFiles(string leadingFile, string labelFile, string trailingFile) | PrintJobTemplate | Loads 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) | PrintJobTemplate | Builds a job from three separate label templates (leading and trailing are optional). |
# SaveFiles(string leadingFile, string labelFile, string trailingFile) | void | Writes the three labels as separate template files (leading/trailing only if present). |
# ToJson() | string | Whole 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"…
public static class PropertyPathFast, 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).
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
RawZplItem
Raw ZPL inserted as-is (escape hatch for commands not covered by items).
public sealed class RawZplItem : LabelItemRaw ZPL inserted as-is (escape hatch for commands not covered by items).
Constructors
| Signature | Description |
|---|---|
# RawZplItem() |
Properties
| Property | Type | Description |
|---|---|---|
Zpl { get; set; } | string |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# ToZpl(ZplContext ctx) | string |
RectangleItem
public sealed class RectangleItem : LabelItemConstructors
| Signature | Description |
|---|---|
# RectangleItem() |
Properties
| Property | Type | Description |
|---|---|---|
CornerRadius { get; set; } | CornerRadius | Individual corner radii in label units (graphic when not expressible by ^GB). |
CornerRounding { get; set; } | int | Corner rounding 0–8 (^GB r). |
Fill { get; set; } | ItemColor | Interior fill (None = transparent). |
Filled { get; set; } | bool | Legacy: same as RectangleItem.Fill = ItemColor.Black (white when RectangleItem.White). |
Height { get; set; } | double | |
StrokeStyle { get; set; } | StrokeStyle | |
StrokeThickness { get; set; } | double | Border thickness in label units; ≥ half the size gives a filled box. |
White { get; set; } | bool | Stroke colour white (^GB W). |
Width { get; set; } | double |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# 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…
public sealed class RepeaterItem : LabelItemRepeats 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
| Signature | Description |
|---|---|
# RepeaterItem() |
Properties
| Property | Type | Description |
|---|---|---|
Items { get; set; } | List<LabelItem> | |
MaxCount { get; set; } | int | |
OffsetX { get; set; } | double | |
OffsetY { get; set; } | double |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# ToZpl(ZplContext ctx) | string |
RfidItem
RFID tag write (^RF). Not printed; encodes RfidItem.Data into the tag.
public sealed class RfidItem : LabelItemRFID tag write (^RF). Not printed; encodes RfidItem.Data into the tag.
Constructors
| Signature | Description |
|---|---|
# RfidItem() |
Properties
| Property | Type | Description |
|---|---|---|
AccessPassword { get; set; } | string | Access password, 8 hex digits (^RZ…,A). |
AccessPasswordLock { get; set; } | RfidLockValue | |
Bank { get; set; } | string | Legacy ^RF bank parameter written verbatim (prefer RfidItem.MemoryBank). |
Data { get; set; } | string | |
EpcDataStructure { get; set; } | string | EPC data structure for format E, e.g. "96,8,3,3,20,24,38" (^RB). |
Format { get; set; } | char | H = hex, A = ASCII, E = EPC. |
KillPassword { get; set; } | string | Kill password, 8 hex digits (^RZ…,K). |
KillPasswordLock { get; set; } | RfidLockValue | |
MemoryBank { get; set; } | RfidMemoryBank | |
MemoryBankLock { get; set; } | RfidLockValue | Lock 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 Signature | Returns | Description |
|---|---|---|
# ToZpl(ZplContext ctx) | string |
RfidLockValue
Lock action for a password or memory bank.
RfidMemoryBank
Gen2 memory bank (^RF m / ^RZ m).
RfidTagType
RFID tag type (^RS tag type parameter).
public enum RfidTagTypeRFID tag type (^RS tag type parameter).
Values
| Name | Value | Description |
|---|---|---|
Default | -1 | Printer default (no ^RS). |
None | 0 | |
EpcClass0 | 1 | |
EpcClass0Plus | 2 | |
EpcClass1_64Bit | 3 | |
EpcClass1_96Bit | 4 | |
UcodeEpc119 | 5 | |
ImpinjClass0Plus | 6 | |
Iso18000_06A | 7 | |
EpcClass1Gen2 | 8 | |
Iso18000_06B | 9 |
Symbology
Label symbologies: every symbology of Barcode. Those with a ZPL barcode command are emitted natively, the others are rendered b…
public enum SymbologyLabel 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
TableItem
Table with fixed columns/rows; cells may contain [Field] placeholders.
public sealed class TableItem : LabelItemTable with fixed columns/rows; cells may contain [Field] placeholders.
Constructors
| Signature | Description |
|---|---|
# TableItem() |
Properties
| Property | Type | Description |
|---|---|---|
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; } | int | Corner 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; } | bool | First 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; } | bool | Vertical lines between columns. |
ShowLeft { get; set; } | bool | Outer border sides. |
ShowRight { get; set; } | bool | |
ShowRowLines { get; set; } | bool | Horizontal lines between rows. |
ShowTop { get; set; } | bool | |
StrokeThickness { get; set; } | double |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# ToZpl(ZplContext ctx) | string |
TextItem
public sealed class TextItem : LabelItemConstructors
| Signature | Description |
|---|---|
# TextItem() |
Properties
| Property | Type | Description |
|---|---|---|
Alignment { get; set; } | TextAlignment | |
AutoFit { get; set; } | bool | Legacy (schema 1): same as TextItem.Sizing = TextSizing.ShrinkToFit. |
Background { get; set; } | ItemColor | Box fill behind the text (needs TextItem.Width). |
Bold { get; set; } | bool | |
BorderCornerRounding { get; set; } | int | Box corner rounding 0–8 (^GB r). |
BorderThickness { get; set; } | double | Box border thickness in label units (0 = none; needs TextItem.Width). |
CharSpacing { get; set; } | double | Extra space between characters in label units (^FP gap). |
CounterStep { get; set; } | int | Counter: add Index × step to the trailing number of the text (e.g. "A0001"). |
CounterUseLeadingZeros { get; set; } | bool | Counter keeps the field width with leading zeros ("A0001" → "A0002"); false drops them ("A2"). |
CultureName { get; set; } | string | Culture for formatting bound values, e.g. "de-DE" (null = current culture). |
Font { get; set; } | string | ZPL font: "0" (scalable), "A".."H" (bitmap) or a downloaded font like "E:ARIAL.TTF". |
FontSize { get; set; } | double | Character height in TextItem.FontUnit (points by default). |
FontUnit { get; set; } | FontUnit | |
FontWidthScale { get; set; } | double | Width scale relative to height (1 = normal). |
ForeColor { get; set; } | ItemColor | Text colour; ItemColor.White prints white (reverse) over a black background. |
FrameThickness { get; set; } | FrameThickness | Frame 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; } | bool | Emit nothing when the (bound) text is empty. |
InputMask { get; set; } | string | Input 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; } | bool | True when the text changes per printed label (counter). |
Italic { get; set; } | bool | |
LineSpacing { get; set; } | double | |
Mask { get; set; } | string | Counter 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; } | string | Increment per printed label for TextItem.Mask: "+1", "-2" or per position like "0010" (carry, wrap-around). |
MaxLength { get; set; } | int | Cut the text after this many characters (0 = unlimited). |
MaxLines { get; set; } | int | |
MinFontSize { get; set; } | double | |
OutlineThickness { get; set; } | double | Draw only the outline of the glyphs, this thick in label units (graphic). |
OverflowItemName { get; set; } | string | Target item of TextSizing.OverflowSplit (must come later in the item list). |
Padding { get; set; } | ItemPadding | |
RightToLeft { get; set; } | bool | Right-to-left print direction (^FPR). |
Rotation { get; set; } | ItemRotation | |
ScaleY { get; set; } | double | Height scale (1 = normal). |
Sizing { get; set; } | TextSizing | |
SlashedZero { get; set; } | bool | Print zeros as slashed zeros (Ø). |
Strikeout { get; set; } | bool | |
Text { get; set; } | string | |
Underline { get; set; } | bool | |
ValidationErrorMessage { get; set; } | string | Message 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; } | string | Regular 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 Signature | Returns | Description |
|---|---|---|
# InputMaskPrompt() | string | The 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.
public enum TextSizingHow a TextItem adapts its text to the box.
Values
| Name | Value | Description |
|---|---|---|
None | 0 | Fixed font size. |
ShrinkToFit | 1 | Shrink the font (down to TextItem.MinFontSize) until the text fits (^FB, native). |
FitToBox | 2 | Largest font size whose wrapped text fits TextItem.Width × TextItem.Height (native). |
Stretch | 3 | Scale the rendered text non-proportionally to fill the box (graphic). |
Arc | 4 | Text bent along the top of a circle (graphic). |
OuterArc | 5 | Text bent along the bottom of a circle, upright (graphic). |
Vertical | 6 | Characters stacked top to bottom (^FPV, native). |
OverflowSplit | 7 | Text that doesn't fit TextItem.MaxLines continues in the item named TextItem.OverflowItemName. |
TextVerticalAlignment
UnitConverter
Conversions between label units and dots.
public static class UnitConverterConversions between label units and dots.
Methods
| Method Signature | Returns | Description |
|---|---|---|
static # Convert(double value, LabelUnit from, LabelUnit to, int dpi = 203) | double | Converts 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) | double | Font size in dots. |
ZplContext
public sealed class ZplContextConstructors
| Signature | Description |
|---|---|
# ZplContext(int dpi, LabelUnit unit, Func<string, object> fieldResolver, int index) |
Properties
| Property | Type | Description |
|---|---|---|
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; } | int | Zero-based record index. |
ItemValues { get; } | Dictionary<string, string> | Resolved text of named items generated so far (usable as [ItemName] in expressions). |
Measurer { get; init; } | ITextMeasurer | Text measurement for auto-fit (provided by the label, uses its fonts). |
Serial { get; init; } | int | Zero-based printed-label number (records × copies) used by counters; -1 = same as ZplContext.Index. |
Unit { get; } | LabelUnit |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# Dots(double value) | int | |
# Dots(double value, LabelUnit? unit) | int | Converts a value given in unit (null = the label unit) to dots. |
# DotsExact(double value, LabelUnit? unit = default) | double | Exact (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) | string | Looks up and formats a field value with an explicit culture (null = current culture). |
# PointsToDots(double pt) | int | Font sizes are always given in points. |
ZplCore.Parsing #
110 typesLow-level ZPL II parser, command AST, and typed ZPL document builder (ZplDocument, ZplBuilder, ZplParser).
AdvancedTextPropertiesCommand
^PA – Advanced text properties.
public sealed class AdvancedTextPropertiesCommand : ZplCommandBase^PA – Advanced text properties.
Constructors
| Signature | Description |
|---|---|
# AdvancedTextPropertiesCommand() |
Properties
| Property | Type | Description |
|---|---|---|
Bidi { get; set; } | int? | |
Code { get; } | string | |
DefaultGlyph { get; set; } | int? | |
OpenType { get; set; } | int? | |
Shaping { get; set; } | int? |
AztecCommand
^B0 – Aztec.
public sealed class AztecCommand : ZplCommandBase^B0 – Aztec.
Constructors
| Signature | Description |
|---|---|
# AztecCommand() |
Properties
| Property | Type | Description |
|---|---|---|
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).
public sealed class AztecOCommand : ZplCommandBase^BO – Aztec (^BO).
Constructors
| Signature | Description |
|---|---|
# AztecOCommand() |
Properties
| Property | Type | Description |
|---|---|---|
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.
public sealed class BarcodeDefaultCommand : ZplCommandBase^BY – Barcode field default.
Constructors
| Signature | Description |
|---|---|
# BarcodeDefaultCommand() |
Properties
| Property | Type | Description |
|---|---|---|
Code { get; } | string | |
Height { get; set; } | int? | |
ModuleWidth { get; set; } | int? | |
Ratio { get; set; } | double? |
CancelAllCommand
~JA – Cancel all.
public sealed class CancelAllCommand : ZplCommandBase~JA – Cancel all.
Constructors
| Signature | Description |
|---|---|
# CancelAllCommand() |
Properties
| Property | Type | Description |
|---|---|---|
Code { get; } | string |
ChangeCaretCommand
^CC – Change caret.
public sealed class ChangeCaretCommand : ZplCommandBase^CC – Change caret.
Constructors
| Signature | Description |
|---|---|
# ChangeCaretCommand() |
Properties
ChangeDefaultFontCommand
^CF – Change alphanumeric default font.
ChangeDelimiterCommand
^CD – Change delimiter.
public sealed class ChangeDelimiterCommand : ZplCommandBase^CD – Change delimiter.
Constructors
| Signature | Description |
|---|---|
# ChangeDelimiterCommand() |
Properties
ChangeFontAliasCommand
^CW – Font identifier.
public sealed class ChangeFontAliasCommand : ZplCommandBase^CW – Font identifier.
Constructors
| Signature | Description |
|---|---|
# ChangeFontAliasCommand() |
Properties
ChangeInternationalEncodingCommand
^CI – Change international font/encoding.
public sealed class ChangeInternationalEncodingCommand : ZplCommandBase^CI – Change international font/encoding.
Constructors
| Signature | Description |
|---|---|
# ChangeInternationalEncodingCommand() |
Properties
ChangeTildeCommand
^CT – Change tilde.
public sealed class ChangeTildeCommand : ZplCommandBase^CT – Change tilde.
Constructors
| Signature | Description |
|---|---|
# ChangeTildeCommand() |
Properties
CodabarCommand
^BK – ANSI Codabar.
public sealed class CodabarCommand : ZplCommandBase^BK – ANSI Codabar.
Constructors
| Signature | Description |
|---|---|
# CodabarCommand() |
Properties
| Property | Type | Description |
|---|---|---|
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.
public sealed class CodablockCommand : ZplCommandBase^BB – CODABLOCK.
Constructors
| Signature | Description |
|---|---|
# CodablockCommand() |
Properties
| Property | Type | Description |
|---|---|---|
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.
public sealed class Code11Command : ZplCommandBase^B1 – Code 11.
Constructors
| Signature | Description |
|---|---|
# Code11Command() |
Properties
| Property | Type | Description |
|---|---|---|
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.
public sealed class Code128Command : ZplCommandBase^BC – Code 128.
Constructors
| Signature | Description |
|---|---|
# Code128Command() |
Properties
| Property | Type | Description |
|---|---|---|
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.
public sealed class Code39Command : ZplCommandBase^B3 – Code 39.
Constructors
| Signature | Description |
|---|---|
# Code39Command() |
Properties
| Property | Type | Description |
|---|---|---|
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.
public sealed class Code49Command : ZplCommandBase^B4 – Code 49.
Constructors
| Signature | Description |
|---|---|
# Code49Command() |
Properties
| Property | Type | Description |
|---|---|---|
Code { get; } | string | |
HeightMultiplier { get; set; } | int? | |
Orientation { get; set; } | ZplOrientation? | |
PrintInterpretation { get; set; } | char? | |
StartingMode { get; set; } | char? |
Code93Command
^BA – Code 93.
public sealed class Code93Command : ZplCommandBase^BA – Code 93.
Constructors
| Signature | Description |
|---|---|
# Code93Command() |
Properties
| Property | Type | Description |
|---|---|---|
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.
public sealed class CommentCommand : ZplCommandBase^FX – Comment.
Constructors
| Signature | Description |
|---|---|
# CommentCommand() |
Properties
DataBarCommand
^BR – GS1 DataBar.
public sealed class DataBarCommand : ZplCommandBase^BR – GS1 DataBar.
Constructors
| Signature | Description |
|---|---|
# DataBarCommand() |
Properties
| Property | Type | Description |
|---|---|---|
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.
public sealed class DataMatrixCommand : ZplCommandBase^BX – Data Matrix.
Constructors
| Signature | Description |
|---|---|
# DataMatrixCommand() |
Properties
| Property | Type | Description |
|---|---|---|
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.
public sealed class DownloadBitmapFontCommand : ZplCommandBase~DB – Download bitmap font.
Constructors
| Signature | Description |
|---|---|
# DownloadBitmapFontCommand() |
Properties
| Property | Type | Description |
|---|---|---|
BaseLine { get; set; } | int? | |
Code { get; } | string | |
Copyright { get; set; } | string | |
Count { get; set; } | int? | |
Data { get; set; } | string | |
DataText { get; } | string | All 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.
public sealed class DownloadFormatCommand : ZplCommandBase^DF – Download format.
Constructors
| Signature | Description |
|---|---|
# DownloadFormatCommand() |
Properties
DownloadGraphicCommand
~DG – Download graphic.
public sealed class DownloadGraphicCommand : ZplCommandBase~DG – Download graphic.
Constructors
| Signature | Description |
|---|---|
# DownloadGraphicCommand() |
Properties
| Property | Type | Description |
|---|---|---|
BytesPerRow { get; set; } | int? | |
Code { get; } | string | |
Data { get; set; } | string | |
DataText { get; } | string | All data after the header parameters (may itself contain commas). |
Name { get; set; } | string | |
TotalBytes { get; set; } | int? |
DownloadObjectsCommand
~DY – Download objects.
public sealed class DownloadObjectsCommand : ZplCommandBase~DY – Download objects.
Constructors
| Signature | Description |
|---|---|
# DownloadObjectsCommand() |
Properties
| Property | Type | Description |
|---|---|---|
BytesPerRow { get; set; } | int? | |
Code { get; } | string | |
Data { get; set; } | string | |
DataText { get; } | string | All 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.
public sealed class DownloadUnboundedFontCommand : ZplCommandBase~DU – Download unbounded TrueType font.
Constructors
| Signature | Description |
|---|---|
# DownloadUnboundedFontCommand() |
Properties
Ean13Command
^BE – EAN-13.
public sealed class Ean13Command : ZplCommandBase^BE – EAN-13.
Constructors
| Signature | Description |
|---|---|
# Ean13Command() |
Properties
| Property | Type | Description |
|---|---|---|
AboveCode { get; set; } | bool? | |
Code { get; } | string | |
Height { get; set; } | int? | |
Orientation { get; set; } | ZplOrientation? | |
PrintInterpretation { get; set; } | bool? |
Ean8Command
^B8 – EAN-8.
public sealed class Ean8Command : ZplCommandBase^B8 – EAN-8.
Constructors
| Signature | Description |
|---|---|
# Ean8Command() |
Properties
| Property | Type | Description |
|---|---|---|
AboveCode { get; set; } | bool? | |
Code { get; } | string | |
Height { get; set; } | int? | |
Orientation { get; set; } | ZplOrientation? | |
PrintInterpretation { get; set; } | bool? |
EndFormatCommand
^XZ – End format.
public sealed class EndFormatCommand : ZplCommandBase^XZ – End format.
Constructors
| Signature | Description |
|---|---|
# EndFormatCommand() |
Properties
| Property | Type | Description |
|---|---|---|
Code { get; } | string |
EraseGraphicsCommand
~EG – Erase download graphics.
public sealed class EraseGraphicsCommand : ZplCommandBase~EG – Erase download graphics.
Constructors
| Signature | Description |
|---|---|
# EraseGraphicsCommand() |
Properties
| Property | Type | Description |
|---|---|---|
Code { get; } | string |
FieldBlockCommand
^FB – Field block.
public sealed class FieldBlockCommand : ZplCommandBase^FB – Field block.
Constructors
| Signature | Description |
|---|---|
# FieldBlockCommand() |
Properties
| Property | Type | Description |
|---|---|---|
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.
FieldDataCommand
^FD – Field data.
public sealed class FieldDataCommand : ZplCommandBase^FD – Field data.
Constructors
| Signature | Description |
|---|---|
# FieldDataCommand() |
Properties
FieldHexCommand
^FH – Field hexadecimal indicator.
public sealed class FieldHexCommand : ZplCommandBase^FH – Field hexadecimal indicator.
Constructors
| Signature | Description |
|---|---|
# FieldHexCommand() |
Properties
FieldLinkCommand
^FL – Font linking.
FieldNumberCommand
^FN – Field number: ^FN#"prompt".
public sealed class FieldNumberCommand : ZplCommandBase^FN – Field number: ^FN#"prompt".
Constructors
| Signature | Description |
|---|---|
# FieldNumberCommand() |
Properties
FieldOrientationCommand
^FW – Field default orientation.
public sealed class FieldOrientationCommand : ZplCommandBase^FW – Field default orientation.
Constructors
| Signature | Description |
|---|---|
# FieldOrientationCommand() |
Properties
| Property | Type | Description |
|---|---|---|
Code { get; } | string | |
Justification { get; set; } | int? | |
Orientation { get; set; } | ZplOrientation? |
FieldOriginCommand
^FO – Field origin.
public sealed class FieldOriginCommand : ZplCommandBase^FO – Field origin.
Constructors
| Signature | Description |
|---|---|
# FieldOriginCommand() |
Properties
| Property | Type | Description |
|---|---|---|
Code { get; } | string | |
Justification { get; set; } | int? | |
X { get; set; } | int? | |
Y { get; set; } | int? |
FieldParameterCommand
^FP – Field parameter (H/V/R).
public sealed class FieldParameterCommand : ZplCommandBase^FP – Field parameter (H/V/R).
Constructors
| Signature | Description |
|---|---|
# FieldParameterCommand() |
Properties
FieldReverseCommand
^FR – Field reverse print.
public sealed class FieldReverseCommand : ZplCommandBase^FR – Field reverse print.
Constructors
| Signature | Description |
|---|---|
# FieldReverseCommand() |
Properties
| Property | Type | Description |
|---|---|---|
Code { get; } | string |
FieldSeparatorCommand
^FS – Field separator.
public sealed class FieldSeparatorCommand : ZplCommandBase^FS – Field separator.
Constructors
| Signature | Description |
|---|---|
# FieldSeparatorCommand() |
Properties
| Property | Type | Description |
|---|---|---|
Code { get; } | string |
FieldTypesetCommand
^FT – Field typeset (baseline origin).
public sealed class FieldTypesetCommand : ZplCommandBase^FT – Field typeset (baseline origin).
Constructors
| Signature | Description |
|---|---|
# FieldTypesetCommand() |
Properties
| Property | Type | Description |
|---|---|---|
Code { get; } | string | |
Justification { get; set; } | int? | |
X { get; set; } | int? | |
Y { get; set; } | int? |
FieldVariableCommand
^FV – Field variable.
public sealed class FieldVariableCommand : ZplCommandBase^FV – Field variable.
Constructors
| Signature | Description |
|---|---|
# FieldVariableCommand() |
Properties
FontCommand
^A – Scalable/bitmapped font: ^Afo,h,w (and ^A@o,h,w,d:o.x for downloaded fonts).
public sealed class FontCommand : ZplCommandBase^A – Scalable/bitmapped font: ^Afo,h,w (and ^A@o,h,w,d:o.x for downloaded fonts).
Constructors
| Signature | Description |
|---|---|
# FontCommand() |
Properties
| Property | Type | Description |
|---|---|---|
Code { get; } | string | |
FontPath { get; set; } | string | Font file (only for ^A@), e.g. "E:ARIAL.TTF". |
Height { get; set; } | int? | |
Name { get; set; } | string | Font 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.
public sealed class GraphicBoxCommand : ZplCommandBase^GB – Graphic box.
Constructors
| Signature | Description |
|---|---|
# GraphicBoxCommand() |
Properties
GraphicCircleCommand
^GC – Graphic circle.
GraphicDiagonalLineCommand
^GD – Graphic diagonal line.
public sealed class GraphicDiagonalLineCommand : ZplCommandBase^GD – Graphic diagonal line.
Constructors
| Signature | Description |
|---|---|
# GraphicDiagonalLineCommand() |
Properties
GraphicEllipseCommand
^GE – Graphic ellipse.
GraphicFieldCommand
^GF – Graphic field (Data = rest incl. commas: see DataText).
public sealed class GraphicFieldCommand : ZplCommandBase^GF – Graphic field (Data = rest incl. commas: see DataText).
Constructors
| Signature | Description |
|---|---|
# GraphicFieldCommand() |
Properties
| Property | Type | Description |
|---|---|---|
BinaryByteCount { get; set; } | int? | |
BytesPerRow { get; set; } | int? | |
Code { get; } | string | |
Compression { get; set; } | char? | |
Data { get; set; } | string | |
DataText { get; } | string | All data after the header parameters (may itself contain commas). |
GraphicFieldCount { get; set; } | int? |
GraphicSymbolCommand
^GS – Graphic symbol.
public sealed class GraphicSymbolCommand : ZplCommandBase^GS – Graphic symbol.
Constructors
| Signature | Description |
|---|---|
# GraphicSymbolCommand() |
Properties
| Property | Type | Description |
|---|---|---|
Code { get; } | string | |
Height { get; set; } | int? | |
Orientation { get; set; } | ZplOrientation? | |
Width { get; set; } | int? |
HostIdentificationCommand
~HI – Host identification.
public sealed class HostIdentificationCommand : ZplCommandBase~HI – Host identification.
Constructors
| Signature | Description |
|---|---|
# HostIdentificationCommand() |
Properties
| Property | Type | Description |
|---|---|---|
Code { get; } | string |
HostQueryCommand
~HQ – Host query.
public sealed class HostQueryCommand : ZplCommandBase~HQ – Host query.
Constructors
| Signature | Description |
|---|---|
# HostQueryCommand() |
Properties
HostStatusCommand
~HS – Host status return.
public sealed class HostStatusCommand : ZplCommandBase~HS – Host status return.
Constructors
| Signature | Description |
|---|---|
# HostStatusCommand() |
Properties
| Property | Type | Description |
|---|---|---|
Code { get; } | string |
ImageLoadCommand
^IL – Image load.
public sealed class ImageLoadCommand : ZplCommandBase^IL – Image load.
Constructors
| Signature | Description |
|---|---|
# ImageLoadCommand() |
Properties
ImageMoveCommand
^IM – Image move.
public sealed class ImageMoveCommand : ZplCommandBase^IM – Image move.
Constructors
| Signature | Description |
|---|---|
# ImageMoveCommand() |
Properties
Industrial2of5Command
^BI – Industrial 2 of 5.
public sealed class Industrial2of5Command : ZplCommandBase^BI – Industrial 2 of 5.
Constructors
| Signature | Description |
|---|---|
# Industrial2of5Command() |
Properties
| Property | Type | Description |
|---|---|---|
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.
public sealed class Interleaved2of5Command : ZplCommandBase^B2 – Interleaved 2 of 5.
Constructors
| Signature | Description |
|---|---|
# Interleaved2of5Command() |
Properties
| Property | Type | Description |
|---|---|---|
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).
public sealed class JobResetCommand : ZplCommandBase^JR – Reset (^JR).
Constructors
| Signature | Description |
|---|---|
# JobResetCommand() |
Properties
| Property | Type | Description |
|---|---|---|
Code { get; } | string |
LabelHomeCommand
^LH – Label home.
public sealed class LabelHomeCommand : ZplCommandBase^LH – Label home.
Constructors
| Signature | Description |
|---|---|
# LabelHomeCommand() |
Properties
LabelLengthCommand
^LL – Label length.
public sealed class LabelLengthCommand : ZplCommandBase^LL – Label length.
Constructors
| Signature | Description |
|---|---|
# LabelLengthCommand() |
Properties
LabelReversePrintCommand
^LR – Label reverse print.
public sealed class LabelReversePrintCommand : ZplCommandBase^LR – Label reverse print.
Constructors
| Signature | Description |
|---|---|
# LabelReversePrintCommand() |
Properties
LabelShiftCommand
^LS – Label shift.
public sealed class LabelShiftCommand : ZplCommandBase^LS – Label shift.
Constructors
| Signature | Description |
|---|---|
# LabelShiftCommand() |
Properties
LabelTopCommand
^LT – Label top.
public sealed class LabelTopCommand : ZplCommandBase^LT – Label top.
Constructors
| Signature | Description |
|---|---|
# LabelTopCommand() |
Properties
LogmarsCommand
^BL – LOGMARS.
public sealed class LogmarsCommand : ZplCommandBase^BL – LOGMARS.
Constructors
| Signature | Description |
|---|---|
# LogmarsCommand() |
Properties
| Property | Type | Description |
|---|---|---|
AboveCode { get; set; } | bool? | |
Code { get; } | string | |
Height { get; set; } | int? | |
Orientation { get; set; } | ZplOrientation? |
MapClearCommand
^MC – Map clear.
public sealed class MapClearCommand : ZplCommandBase^MC – Map clear.
Constructors
| Signature | Description |
|---|---|
# MapClearCommand() |
Properties
MaxiCodeCommand
^BD – MaxiCode.
public sealed class MaxiCodeCommand : ZplCommandBase^BD – MaxiCode.
Constructors
| Signature | Description |
|---|---|
# MaxiCodeCommand() |
Properties
| Property | Type | Description |
|---|---|---|
Code { get; } | string | |
Mode { get; set; } | int? | |
SymbolNumber { get; set; } | int? | |
TotalSymbols { get; set; } | int? |
MediaDarknessCommand
^MD – Media darkness.
public sealed class MediaDarknessCommand : ZplCommandBase^MD – Media darkness.
Constructors
| Signature | Description |
|---|---|
# MediaDarknessCommand() |
Properties
MediaModeCommand
^MM – Print mode.
public sealed class MediaModeCommand : ZplCommandBase^MM – Print mode.
Constructors
| Signature | Description |
|---|---|
# MediaModeCommand() |
Properties
MediaTrackingCommand
^MN – Media tracking.
public sealed class MediaTrackingCommand : ZplCommandBase^MN – Media tracking.
Constructors
| Signature | Description |
|---|---|
# MediaTrackingCommand() |
Properties
MediaTypeCommand
^MT – Media type.
public sealed class MediaTypeCommand : ZplCommandBase^MT – Media type.
Constructors
| Signature | Description |
|---|---|
# MediaTypeCommand() |
Properties
MicroPdf417Command
^BF – MicroPDF417.
public sealed class MicroPdf417Command : ZplCommandBase^BF – MicroPDF417.
Constructors
| Signature | Description |
|---|---|
# MicroPdf417Command() |
Properties
| Property | Type | Description |
|---|---|---|
Code { get; } | string | |
Height { get; set; } | int? | |
Mode { get; set; } | int? | |
Orientation { get; set; } | ZplOrientation? |
MsiCommand
^BM – MSI.
public sealed class MsiCommand : ZplCommandBase^BM – MSI.
Constructors
| Signature | Description |
|---|---|
# MsiCommand() |
Properties
| Property | Type | Description |
|---|---|---|
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.
public sealed class Pdf417Command : ZplCommandBase^B7 – PDF417.
Constructors
| Signature | Description |
|---|---|
# Pdf417Command() |
Properties
| Property | Type | Description |
|---|---|---|
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.
public sealed class PlanetCommand : ZplCommandBase^B5 – Planet code.
Constructors
| Signature | Description |
|---|---|
# PlanetCommand() |
Properties
| Property | Type | Description |
|---|---|---|
AboveCode { get; set; } | bool? | |
Code { get; } | string | |
Height { get; set; } | int? | |
Orientation { get; set; } | ZplOrientation? | |
PrintInterpretation { get; set; } | bool? |
PlesseyCommand
^BP – Plessey.
public sealed class PlesseyCommand : ZplCommandBase^BP – Plessey.
Constructors
| Signature | Description |
|---|---|
# PlesseyCommand() |
Properties
| Property | Type | Description |
|---|---|---|
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.
public sealed class PostalCodeCommand : ZplCommandBase^BZ – POSTAL / Intelligent Mail.
Constructors
| Signature | Description |
|---|---|
# PostalCodeCommand() |
Properties
| Property | Type | Description |
|---|---|---|
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.
public sealed class PrintMirrorCommand : ZplCommandBase^PM – Print mirror image.
Constructors
| Signature | Description |
|---|---|
# PrintMirrorCommand() |
Properties
PrintOrientationCommand
^PO – Print orientation (N/I).
public sealed class PrintOrientationCommand : ZplCommandBase^PO – Print orientation (N/I).
Constructors
| Signature | Description |
|---|---|
# PrintOrientationCommand() |
Properties
| Property | Type | Description |
|---|---|---|
Code { get; } | string | |
Orientation { get; set; } | char? |
PrintQuantityCommand
^PQ – Print quantity.
public sealed class PrintQuantityCommand : ZplCommandBase^PQ – Print quantity.
Constructors
| Signature | Description |
|---|---|
# PrintQuantityCommand() |
Properties
| Property | Type | Description |
|---|---|---|
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.
public sealed class PrintRateCommand : ZplCommandBase^PR – Print rate.
Constructors
| Signature | Description |
|---|---|
# PrintRateCommand() |
Properties
| Property | Type | Description |
|---|---|---|
BackfeedSpeed { get; set; } | string | |
Code { get; } | string | |
PrintSpeed { get; set; } | string | |
SlewSpeed { get; set; } | string |
PrintWidthCommand
^PW – Print width.
public sealed class PrintWidthCommand : ZplCommandBase^PW – Print width.
Constructors
| Signature | Description |
|---|---|
# PrintWidthCommand() |
Properties
QrCodeCommand
^BQ – QR code.
public sealed class QrCodeCommand : ZplCommandBase^BQ – QR code.
Constructors
| Signature | Description |
|---|---|
# QrCodeCommand() |
Properties
| Property | Type | Description |
|---|---|---|
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.
public sealed class RecallFormatCommand : ZplCommandBase^XF – Recall format.
Constructors
| Signature | Description |
|---|---|
# RecallFormatCommand() |
Properties
RecallGraphicCommand
^XG – Recall graphic.
public sealed class RecallGraphicCommand : ZplCommandBase^XG – Recall graphic.
Constructors
| Signature | Description |
|---|---|
# RecallGraphicCommand() |
Properties
| Property | Type | Description |
|---|---|---|
Code { get; } | string | |
MagnificationX { get; set; } | int? | |
MagnificationY { get; set; } | int? | |
Name { get; set; } | string |
RfidReadWriteCommand
^RF – Read or write RFID format.
public sealed class RfidReadWriteCommand : ZplCommandBase^RF – Read or write RFID format.
Constructors
| Signature | Description |
|---|---|
# RfidReadWriteCommand() |
Properties
SerializationFieldCommand
^SN – Serialization data.
public sealed class SerializationFieldCommand : ZplCommandBase^SN – Serialization data.
Constructors
| Signature | Description |
|---|---|
# SerializationFieldCommand() |
Properties
| Property | Type | Description |
|---|---|---|
Code { get; } | string | |
Increment { get; set; } | string | |
LeadingZeros { get; set; } | bool? | |
Start { get; set; } | string |
SerializationFieldStandardCommand
^SF – Serialization field with mask.
public sealed class SerializationFieldStandardCommand : ZplCommandBase^SF – Serialization field with mask.
Constructors
| Signature | Description |
|---|---|
# SerializationFieldStandardCommand() |
Properties
SetDateTimeCommand
^ST – Set date and time.
public sealed class SetDateTimeCommand : ZplCommandBase^ST – Set date and time.
Constructors
| Signature | Description |
|---|---|
# SetDateTimeCommand() |
Properties
SetUnitsCommand
^MU – Set units of measurement.
public sealed class SetUnitsCommand : ZplCommandBase^MU – Set units of measurement.
Constructors
| Signature | Description |
|---|---|
# SetUnitsCommand() |
Properties
| Property | Type | Description |
|---|---|---|
Code { get; } | string | |
Conversion { get; set; } | int? | |
Format { get; set; } | int? | |
Units { get; set; } | char? |
SlotTimeOffsetCommand
^SO – Set offset for real time clock.
public sealed class SlotTimeOffsetCommand : ZplCommandBase^SO – Set offset for real time clock.
Constructors
| Signature | Description |
|---|---|
# SlotTimeOffsetCommand() |
Properties
Standard2of5Command
^BJ – Standard 2 of 5.
public sealed class Standard2of5Command : ZplCommandBase^BJ – Standard 2 of 5.
Constructors
| Signature | Description |
|---|---|
# Standard2of5Command() |
Properties
| Property | Type | Description |
|---|---|---|
AboveCode { get; set; } | bool? | |
Code { get; } | string | |
Height { get; set; } | int? | |
Orientation { get; set; } | ZplOrientation? | |
PrintInterpretation { get; set; } | bool? |
StartFormatCommand
^XA – Start format.
public sealed class StartFormatCommand : ZplCommandBase^XA – Start format.
Constructors
| Signature | Description |
|---|---|
# StartFormatCommand() |
Properties
| Property | Type | Description |
|---|---|---|
Code { get; } | string |
TextBlockCommand
^TB – Text block.
public sealed class TextBlockCommand : ZplCommandBase^TB – Text block.
Constructors
| Signature | Description |
|---|---|
# TextBlockCommand() |
Properties
| Property | Type | Description |
|---|---|---|
Code { get; } | string | |
Height { get; set; } | int? | |
Orientation { get; set; } | ZplOrientation? | |
Width { get; set; } | int? |
Tlc39Command
^BT – TLC39.
public sealed class Tlc39Command : ZplCommandBase^BT – TLC39.
Constructors
| Signature | Description |
|---|---|
# Tlc39Command() |
Properties
| Property | Type | Description |
|---|---|---|
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.
public sealed class UnknownCommand : ZplCommandBaseFallback for commands without a dedicated class.
Constructors
| Signature | Description |
|---|---|
# UnknownCommand() | |
# UnknownCommand(string code) | Fallback for commands without a dedicated class. |
Properties
| Property | Type | Description |
|---|---|---|
Code { get; } | string | |
Parameters { get; set; } | string |
UpcACommand
^BU – UPC-A.
public sealed class UpcACommand : ZplCommandBase^BU – UPC-A.
Constructors
| Signature | Description |
|---|---|
# UpcACommand() |
Properties
| Property | Type | Description |
|---|---|---|
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.
public sealed class UpcECommand : ZplCommandBase^B9 – UPC-E.
Constructors
| Signature | Description |
|---|---|
# UpcECommand() |
Properties
| Property | Type | Description |
|---|---|---|
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.
public sealed class UpcEanExtensionCommand : ZplCommandBase^BS – UPC/EAN extensions.
Constructors
| Signature | Description |
|---|---|
# UpcEanExtensionCommand() |
Properties
| Property | Type | Description |
|---|---|---|
AboveCode { get; set; } | bool? | |
Code { get; } | string | |
Height { get; set; } | int? | |
Orientation { get; set; } | ZplOrientation? | |
PrintInterpretation { get; set; } | bool? |
WriteConfigurationCommand
~WC – Print configuration label.
public sealed class WriteConfigurationCommand : ZplCommandBase~WC – Print configuration label.
Constructors
| Signature | Description |
|---|---|
# WriteConfigurationCommand() |
Properties
| Property | Type | Description |
|---|---|---|
Code { get; } | string |
ZplBuilder
Fluent ZPL builder: new ZplBuilder().Format(f => f.FieldOrigin(10, 10).Font("0", 30, 30).FieldData("Hi")…
public sealed class ZplBuilderFluent ZPL builder: new ZplBuilder().Format(f => f.FieldOrigin(10, 10).Font("0", 30, 30).FieldData("Hi")).ToString().
Constructors
| Signature | Description |
|---|---|
# ZplBuilder() |
Properties
| Property | Type | Description |
|---|---|---|
Document { get; } | ZplDocument |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# Format(Action<ZplFormatBuilder> build) | ZplBuilder | Adds a ^XA…^XZ label format. |
# Raw(params ZplCommandBase[] commands) | ZplBuilder | Adds 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".
public record ZplCommandA single ZPL command, e.g. ^FO50,100 → Prefix '^', Name "FO", Parameters "50,100".
Constructors
| Signature | Description |
|---|---|
# ZplCommand(char Prefix, string Name, string Parameters) | A single ZPL command, e.g. ^FO50,100 → Prefix '^', Name "FO", Parameters "50,100". |
Properties
| Property | Type | Description |
|---|---|---|
Length { get; init; } | int | Length of the command in the source, prefix and parameters included. |
Name { get; init; } | string | |
Offset { get; init; } | int | Character offset of the command prefix in the parsed source (-1 when not parsed from text). |
Parameters { get; init; } | string | |
Prefix { get; init; } | char |
Methods
ZplCommandBase
Base class of all typed ZPL commands. Parameters are stored positionally (lossless) and exposed by derived classes as named, ty…
public abstract class ZplCommandBaseBase 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
| Property | Type | Description |
|---|---|---|
Arguments { get; } | IReadOnlyList<string> | Raw positional arguments (as parsed, delimiter normalized to ','). |
Code { get; } | string | Command mnemonic without prefix, e.g. "FO", "BC", "A". |
ParameterText { get; set; } | string | The parameter text after the mnemonic. |
Prefix { get; set; } | char | '^' or '~'. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
static # From(ZplCommand raw) | ZplCommandBase | Creates a typed command from a tokenized one (unknown mnemonics yield UnknownCommand). |
# GetRaw(int i) | string | |
# SetRaw(int i, string value) | void | |
# ToString() | string | Serializes with the standard control characters. |
# ToString(char caret, char tilde, char delimiter) | string | Serializes with the given control characters (see ^CC, ^CT, ^CD). |
ZplDocument
Typed object model of a ZPL stream.
public sealed class ZplDocumentTyped object model of a ZPL stream.
Constructors
| Signature | Description |
|---|---|
# ZplDocument() |
Properties
| Property | Type | Description |
|---|---|---|
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 Signature | Returns | Description |
|---|---|---|
static # Parse(string zpl) | ZplDocument | |
# ToString() | string | |
# ToZpl(ZplOutputOptions? options = default) | string | Serializes 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.
public record ZplFieldInfoA variable ^FN field found by ZplFields.Find.
Constructors
| Signature | Description |
|---|---|
# 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
| Property | Type | Description |
|---|---|---|
Count { get; init; } | int | Number of fields with this number (stored formats and labels, ^XF data blocks not counted). |
Format { get; init; } | string | Name of the stored format (^DF) the field belongs to, or null for fields of an ordinary label. |
Number { get; init; } | int | Field number (^FN1 → 1). |
Offset { get; init; } | int | Source offset of the first ^FN command with this number. |
Prompt { get; init; } | string | Prompt text of the first ^FN with one (^FN1"Name" → "Name"), or null. |
Value { get; init; } | string | Data that prints without an override: the ^XF data block value, else the ^FD default of the field (null when none). |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# 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…
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 Signature | Returns | Description |
|---|---|---|
static # Fill(string zpl, IReadOnlyDictionary<int, string>? values = default) | string | Returns 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.
public sealed class ZplFormatOne label format (^XA … ^XZ) or a run of commands outside any format.
Constructors
| Signature | Description |
|---|---|
# ZplFormat() |
Properties
| Property | Type | Description |
|---|---|---|
Commands { get; } | List<ZplCommandBase> | |
IsLabelFormat { get; } | bool | True when the commands are enclosed by ^XA/^XZ. |
Methods
ZplFormatBuilder
Builds the commands of one label format. Field-producing methods close the field with ^FS when data is given.
public sealed class ZplFormatBuilderBuilds the commands of one label format. Field-producing methods close the field with ^FS when data is given.
Constructors
| Signature | Description |
|---|---|
# ZplFormatBuilder(ZplFormat format) | Builds the commands of one label format. Field-producing methods close the field with ^FS when data is given. |
Properties
Methods
| Method Signature | Returns | Description |
|---|---|---|
# 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) | ZplFormatBuilder | Convenience: ^FO + ^A + ^FD + ^FS. |
ZplOrientation
Field / barcode orientation (N, R, I, B).
ZplOutputOptions
How ZplDocument.ToZpl writes ZPL. Every layout keeps the command stream: the output parses to the same commands (generated ^FX …
public sealed class ZplOutputOptionsHow 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
| Signature | Description |
|---|---|
# ZplOutputOptions() |
Properties
| Property | Type | Description |
|---|---|---|
AddComments { get; set; } | bool | Pretty-print only: inserts a ^FX comment describing each field (text, barcode, box … and its position). |
FieldsOnOneLine { get; set; } | bool | Pretty-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; } | int | Spaces per indentation level when pretty-printing (0–8, default 2). |
static Minified { get; } | ZplOutputOptions | Smallest output: no whitespace between commands and no ^FX comments. |
Minify { get; set; } | bool | No whitespace between commands (one label per line). Wins over ZplOutputOptions.PrettyPrint. |
NewLine { get; set; } | string | Line break written between lines (default "\n"). |
static Pretty { get; } | ZplOutputOptions | One command per line with indented field blocks. |
PrettyPrint { get; set; } | bool | One command per line, label contents and field blocks (^FO/^FT … ^FS) indented. |
StripComments { get; set; } | bool | Removes 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…
public static class ZplParserTokenizes 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 Signature | Returns | Description |
|---|---|---|
static # DecodeFieldHex(string data, char indicator, Encoding encoding) | string | Decodes ^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 typesPrinter 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.
CupsPrinterConnection
Sends raw data to a CUPS queue on macOS/Linux via lp -d <queue> -o raw. Write-only.
public sealed class CupsPrinterConnection : IPrinterConnection, IAsyncDisposableSends raw data to a CUPS queue on macOS/Linux via lp -d <queue> -o raw. Write-only.
Constructors
| Signature | Description |
|---|---|
# CupsPrinterConnection(string queue, string lpPath = "lp") |
Properties
Methods
| Method Signature | Returns | Description |
|---|---|---|
# BuildArguments() | IReadOnlyList<string> | The argument list passed to lp. |
# DisposeAsync() | ValueTask | |
static # IsValidQueueName(string queue) | bool | CUPS 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.
public record DiscoveredPrinterA locally attached printer found by PrinterDiscovery.
Constructors
| Signature | Description |
|---|---|
# 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
| Property | Type | Description |
|---|---|---|
Address { get; init; } | string | Device path, spooler port or CUPS device URI. |
Name { get; init; } | string | Display name (queue / spooler name or device file). |
Settings { get; init; } | PrinterSettings | Ready-to-use connection settings. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# 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…
public sealed class DryRunPrinterConnection : IPrinterConnection, IAsyncDisposableDry-run connection (PrinterSettings.EnablePrinting = false): records everything that would be sent, prints nothing. Queries return null.
Constructors
| Signature | Description |
|---|---|
# DryRunPrinterConnection() |
Properties
| Property | Type | Description |
|---|---|---|
Jobs { get; } | IReadOnlyList<byte[]> | Snapshot of the recorded jobs (one entry per SendAsync call). |
Target { get; init; } | string | Optional connection that would have been used (for diagnostics). |
Text { get; } | string | All recorded data decoded as UTF-8. |
Methods
IPrinterConnection
A bidirectional (where supported) raw connection to a label printer.
public interface IPrinterConnection : IAsyncDisposableA bidirectional (where supported) raw connection to a label printer.
Methods
| Method Signature | Returns | Description |
|---|---|---|
# 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) | Task | Sends raw bytes (ZPL, EPL, graphics) to the printer. |
JobOrientation
Job orientation: rotates all fields without explicit orientation (^FW) or the whole format (^PO).
public enum JobOrientationJob orientation: rotates all fields without explicit orientation (^FW) or the whole format (^PO).
Values
| Name | Value | Description |
|---|---|---|
Portrait | 0 | |
Landscape90 | 90 | Fields rotated 90° clockwise (^FWR). |
Portrait180 | 180 | Format printed upside down (^POI). |
Landscape270 | 270 | Fields rotated 270° (^FWB). |
MediaTracking
Media sensing / tracking (^MN).
public enum MediaTrackingMedia sensing / tracking (^MN).
Values
| Name | Value | Description |
|---|---|---|
Continuous | 78 | Continuous media (no gaps); label length comes from ^LL. |
Gap | 89 | Non-continuous web (gap/notch) sensing. |
Mark | 77 | Non-continuous media, black mark sensing. |
Auto | 65 | Auto-detect on calibration. |
ContinuousVariable | 86 | Continuous media with variable length. |
MediaType
Media type (^MT).
public enum MediaTypeMedia type (^MT).
Values
| Name | Value | Description |
|---|---|---|
ThermalTransfer | 84 | |
DirectThermal | 68 |
ParallelPrinterConnection
Parallel (Centronics/IEEE 1284) port. Writes to the port device: "LPT1".."LPT9" on Windows (or a spooler pr…
public sealed class ParallelPrinterConnection : IPrinterConnection, IAsyncDisposableParallel (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
| Signature | Description |
|---|---|
# ParallelPrinterConnection(string port = "LPT1") |
Properties
| Property | Type | Description |
|---|---|---|
DevicePath { get; } | string | The device path written to. |
Port { get; } | string |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# DisposeAsync() | ValueTask | |
# QueryAsync(string command, TimeSpan timeout, CancellationToken ct = default) | Task<string> | |
static # ResolveDevicePath(string port, bool windows) | string | Maps "LPTn" to the OS device path. |
# SendAsync(byte[] data, CancellationToken ct = default) | Task |
PrintMode
Post-print action (^MM).
public enum PrintModePost-print action (^MM).
Values
| Name | Value | Description |
|---|---|---|
TearOff | 84 | |
PeelOff | 80 | |
Rewind | 82 | |
Applicator | 65 | |
Cutter | 67 | |
DelayedCutter | 68 | |
Rfid | 70 | |
Linerless | 76 | |
Kiosk | 75 |
PrinterConnectionExtensions
Convenience extensions for IPrinterConnection.
public static class PrinterConnectionExtensionsConvenience extensions for IPrinterConnection.
Methods
| Method Signature | Returns | Description |
|---|---|---|
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.
public static class PrinterConnectionFactoryCreates the IPrinterConnection for a PrinterSettings.
Methods
| Method Signature | Returns | Description |
|---|---|---|
static # Create(PrinterSettings settings) | IPrinterConnection |
PrinterDiscovery
Best-effort enumeration of USB-attached printers (no extra dependencies, no raw USB access).
public static class PrinterDiscoveryBest-effort enumeration of USB-attached printers (no extra dependencies, no raw USB access).
/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 Signature | Returns | Description |
|---|---|---|
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.
public sealed class PrinterSettingsConnection settings; only the members relevant to PrinterSettings.CommunicationType are used.
Constructors
| Signature | Description |
|---|---|
# PrinterSettings() |
Properties
| Property | Type | Description |
|---|---|---|
BaudRate { get; set; } | int | |
CommunicationType { get; set; } | CommunicationType | |
DataBits { get; set; } | int | |
DevicePath { get; set; } | string | USB/File: device path (/dev/usb/lp0, \\.\USB001, file). Parallel: port ("LPT1") or device path (/dev/lp0). |
EnablePrinting { get; set; } | bool | False = 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; } | ZplJobSettings | Optional 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; } | string | WindowsDriver: installed printer name; Cups: queue name. |
SerialPort { get; set; } | string | |
StopBits { get; set; } | StopBits | |
Stream { get; set; } | Stream | Stream: caller-owned stream. |
Timeout { get; set; } | TimeSpan | |
UseDefaultPrinter { get; set; } | bool | WindowsDriver: 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.
public sealed class RawFilePrinterConnection : IPrinterConnection, IAsyncDisposableWrites to a device path or file: /dev/usb/lp0, LPT1, \\.\USB001, a share, or a plain file. Write-only.
Constructors
| Signature | Description |
|---|---|
# 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
Methods
SerialPrinterConnection
RS-232 / virtual COM port connection (System.IO.Ports). Opens the port per call.
public sealed class SerialPrinterConnection : IPrinterConnection, IAsyncDisposableRS-232 / virtual COM port connection (System.IO.Ports). Opens the port per call.
Constructors
| Signature | Description |
|---|---|
# SerialPrinterConnection(string portName, int baudRate = 9600, Parity parity = Parity.None, int dataBits = 8, StopBits stopBits = StopBits.One, Handshake handshake = Handshake.XOnXOff) |
Properties
| Property | Type | Description |
|---|---|---|
BaudRate { get; } | int | |
DataBits { get; } | int | |
Handshake { get; } | Handshake | |
Parity { get; } | Parity | |
PortName { get; } | string | |
StopBits { get; } | StopBits | |
WriteTimeout { get; set; } | TimeSpan |
Methods
StreamPrinterConnection
Writes to (and reads from) any caller-owned stream.
public sealed class StreamPrinterConnection : IPrinterConnection, IAsyncDisposableWrites to (and reads from) any caller-owned stream.
Constructors
| Signature | Description |
|---|---|
# StreamPrinterConnection(Stream stream, bool leaveOpen = true) | Writes to (and reads from) any caller-owned stream. |
Properties
| Property | Type | Description |
|---|---|---|
Stream { get; } | Stream |
Methods
TcpPrinterConnection
Raw TCP (port 9100) connection. Opens one socket per call, like ZplPrinterClient.
public sealed class TcpPrinterConnection : IPrinterConnection, IAsyncDisposableRaw TCP (port 9100) connection. Opens one socket per call, like ZplPrinterClient.
Constructors
| Signature | Description |
|---|---|
# TcpPrinterConnection(ZplPrinterClient client) | |
# TcpPrinterConnection(string host, int port = 9100) |
Properties
| Property | Type | Description |
|---|---|---|
Client { get; } | ZplPrinterClient | The wrapped client (host, port, timeout, encoding). |
Methods
VirtualCutEventArgs
The cutter of ZplVirtualPrinter cut after a label.
public sealed class VirtualCutEventArgs : EventArgsThe cutter of ZplVirtualPrinter cut after a label.
Constructors
| Signature | Description |
|---|---|
# VirtualCutEventArgs(int labelIndex, ZplCutReason reason, int partialCutMm) | The cutter of ZplVirtualPrinter cut after a label. |
Properties
| Property | Type | Description |
|---|---|---|
LabelIndex { get; } | int | VirtualLabelEventArgs.Index of the label the cut follows. |
PartialCutMm { get; } | int | Kiosk partial cut: millimetres left uncut (0 = full cut). |
Reason { get; } | ZplCutReason |
VirtualJobEventArgs
Raw data received by ZplVirtualPrinter (one processed segment).
public sealed class VirtualJobEventArgs : EventArgsRaw data received by ZplVirtualPrinter (one processed segment).
Constructors
| Signature | Description |
|---|---|
# VirtualJobEventArgs(int connectionId, EndPoint remote, byte[] data, bool isEpl) | Raw data received by ZplVirtualPrinter (one processed segment). |
Properties
| Property | Type | Description |
|---|---|---|
ConnectionId { get; } | int | |
Data { get; } | byte[] | |
IsEpl { get; } | bool | |
RemoteEndPoint { get; } | EndPoint |
VirtualLabelEventArgs
A label rendered by ZplVirtualPrinter.
public sealed class VirtualLabelEventArgs : EventArgsA label rendered by ZplVirtualPrinter.
Constructors
| Signature | Description |
|---|---|
# VirtualLabelEventArgs(int connectionId, EndPoint remote, int index, byte[] data, string filePath) | A label rendered by ZplVirtualPrinter. |
Properties
| Property | Type | Description |
|---|---|---|
ConnectionId { get; } | int | Sequential id of the TCP connection (one renderer/printer memory per connection). |
Cut { get; init; } | ZplLabelCut | Cut 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; } | string | File written to ZplVirtualPrinter.OutputDirectory, if any. |
Index { get; } | int | Running label number across the printer's lifetime. |
RemoteEndPoint { get; } | EndPoint | |
Rfid { get; init; } | RfidLabelResult | Result of the tag simulation for this label (ZplVirtualPrinter.RfidSimulator), null when off or not an RFID label. |
Voided { get; init; } | bool | RFID 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.
public sealed class WindowsSpoolerPrinterConnection : IPrinterConnection, IAsyncDisposableRaw printing through the Windows spooler (winspool.drv, datatype RAW) to an installed printer/driver. Write-only.
Constructors
| Signature | Description |
|---|---|
# WindowsSpoolerPrinterConnection(string printerName, string documentName = "ZPL") |
Properties
| Property | Type | Description |
|---|---|---|
DocumentName { get; } | string | |
PrinterName { get; } | string |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# DisposeAsync() | ValueTask | |
static # EnumeratePrinters() | IReadOnlyList<(string, string)> | Installed printers with their port names (e.g. "USB001", "LPT1:", "IP_10.0.0.5"). |
static # GetDefaultPrinterName() | string | Name 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.
public sealed class ZplChaosScriptA chaos script: printer options and faults as JSON, e.g. for zplcore serve --chaos script.json.
Constructors
| Signature | Description |
|---|---|
# ZplChaosScript() |
Properties
| Property | Type | Description |
|---|---|---|
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 Signature | Returns | Description |
|---|---|---|
# ApplyTo(ZplVirtualPrinter printer) | void | Applies the printer options of the script to printer and loads the faults. |
static # FromJson(string json) | ZplChaosScript | Parses the JSON (property names case-insensitive, fault kinds camelCase or PascalCase). |
ZplExtendedStatus
Parsed ~HQES (host query, extended status) response.
public record ZplExtendedStatusParsed ~HQES (host query, extended status) response.
Constructors
| Signature | Description |
|---|---|
# ZplExtendedStatus(bool HasErrors, ZplPrinterErrors Errors, long ErrorGroup2, bool HasWarnings, ZplPrinterWarnings Warnings, long WarningGroup2, string Raw) | Parsed ~HQES (host query, extended status) response. |
Properties
| Property | Type | Description |
|---|---|---|
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 Signature | Returns | Description |
|---|---|---|
static # CleanResponse(string raw) | string | Strips 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) | ZplExtendedStatus | Parses the ~HQES text ("ERRORS: 1 00000000 00000005", "WARNINGS: ..."). |
ZplFaultEventArgs
Raised when a fault becomes active or is cleared.
public sealed class ZplFaultEventArgs : EventArgsRaised when a fault becomes active or is cleared.
Constructors
| Signature | Description |
|---|---|
# ZplFaultEventArgs(ZplFaultKind kind, string cause, ZplFaultRule rule) | Raised when a fault becomes active or is cleared. |
Properties
| Property | Type | Description |
|---|---|---|
Cause { get; } | string | What raised or cleared it: "api", "~PS", "^PQ pause", "trigger", "timeout", "memory" ... |
Kind { get; } | ZplFaultKind | |
Rule { get; } | ZplFaultRule | The scheduled rule, if any. |
ZplFaultKind
Printer conditions and communication faults simulated by ZplVirtualPrinter (ZplVirtualPrinter.Faults).
public enum ZplFaultKindPrinter conditions and communication faults simulated by ZplVirtualPrinter (ZplVirtualPrinter.Faults).
Values
| Name | Value | Description |
|---|---|---|
PaperOut | 0 | Media out: ~HS paper out flag, ~HQES error 0x1. Labels stay in the buffer until cleared. |
RibbonOut | 1 | Ribbon out: ~HS ribbon out flag, ~HQES error 0x2. |
HeadOpen | 2 | Printhead open: ~HS head up flag, ~HQES error 0x4, SGD head.latch "open". |
HeadOverTemperature | 3 | Printhead over temperature: ~HS over temperature flag, ~HQES error 0x10. |
MotorOverTemperature | 4 | Motor over temperature: ~HQES error 0x20. |
CutterFault | 5 | Cutter fault / jam: ~HQES error 0x8 (also raised for cutter modes when the printer has no cutter). |
Pause | 6 | Pause (like ~PP or the PAUSE key): ~HS pause flag, ~HQES error 0x10000; cleared by ~PS. |
HeadUnderTemperature | 7 | Printhead under temperature: ~HS under temperature flag (the printer keeps printing). |
CorruptRam | 8 | Corrupt RAM (configuration data lost): ~HS flag j. |
PaperNearEnd | 9 | Paper near end: ~HQES warning 0x8. |
CleanPrinthead | 10 | Clean printhead: ~HQES warning 0x2. |
ReplacePrinthead | 11 | Replace printhead: ~HQES warning 0x4. |
BufferFull | 12 | Receive buffer full: ~HS buffer full flag; the printer stops reading from the socket (TCP back-pressure). |
OutOfMemory | 13 | Printer memory full: ~DG/~DY/~DU/^DF downloads are rejected (also raised as an event when the memory is exhausted). |
RfidVoid | 14 | RFID encode error: labels with ^RF/^WT/^RQ print VOID and are retried (^RS n tries, error handling e). |
DropLabels | 15 | Labels are lost: rendered but not printed (LabelDropped). |
Disconnect | 16 | Connection reset (RST): with ZplFaultTrigger.AfterBytes exactly at that byte (the rest of the job is lost), otherwise all open connections. |
CommunicationTimeout | 17 | Communication timeout: the printer neither reads nor answers (connections stay open). |
Latency | 18 | Every response is delayed by ZplFaultRule.Delay. |
SlowReceive | 19 | Data is read at ZplFaultRule.BytesPerSecond (slow printer, host writes block). |
PartialWrites | 20 | Responses are written in pieces of ZplFaultRule.ChunkSize bytes with ZplFaultRule.Delay in between. |
PowerOff | 21 | Printer 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.
public record ZplFaultRuleA scheduled fault: what (ZplFaultRule.Kind), when (ZplFaultRule.Trigger) and how long.
Constructors
| Signature | Description |
|---|---|
# ZplFaultRule(ZplFaultKind Kind, ZplFaultTrigger Trigger) | A scheduled fault: what (ZplFaultRule.Kind), when (ZplFaultRule.Trigger) and how long. |
Properties
| Property | Type | Description |
|---|---|---|
BytesPerSecond { get; init; } | int | ZplFaultKind.SlowReceive: receive rate. |
ChunkSize { get; init; } | int | ZplFaultKind.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; } | TimeSpan | Latency per response, or pause between partial writes. |
Kind { get; init; } | ZplFaultKind | |
Repeat { get; init; } | bool | ZplFaultTriggerKind.OnCommand / ZplFaultTriggerKind.Random: fire every time instead of once. |
Trigger { get; init; } | ZplFaultTrigger |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# Deconstruct(out ZplFaultKind Kind, out ZplFaultTrigger Trigger) | void |
ZplFaultTrigger
Trigger of a ZplFaultRule; counts start when the rule is scheduled.
public record ZplFaultTriggerTrigger of a ZplFaultRule; counts start when the rule is scheduled.
Constructors
| Signature | Description |
|---|---|
# 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
| Property | Type | Description |
|---|---|---|
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 Signature | Returns | Description |
|---|---|---|
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) | ZplFaultTrigger | A command with prefix, e.g. "~JA", "^RF", "^XZ" (case-insensitive). |
static # Random(double probability) | ZplFaultTrigger | Fires before a label with probability probability (0..1). |
ZplFaultTriggerKind
When a scheduled fault fires.
public enum ZplFaultTriggerKindWhen a scheduled fault fires.
Values
| Name | Value | Description |
|---|---|---|
Immediately | 0 | Now. |
AfterLabels | 1 | After n more labels have been printed. |
AfterBytes | 2 | After n more bytes have been received. |
AfterCuts | 3 | After n more cuts. |
OnCommand | 4 | When a command (e.g. "~JA", "^RF", "^XZ") is received, before the format containing it prints. |
AfterTime | 5 | After a time span. |
Random | 6 | Before each label with a probability (seeded by ZplPrinterFaults.Seed). |
ZplHostQueryExtensions
~HQ host query extensions.
public static class ZplHostQueryExtensions~HQ host query extensions.
Methods
| Method Signature | Returns | Description |
|---|---|---|
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 …
public sealed class ZplJobSettingsPrinter 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
| Signature | Description |
|---|---|
# ZplJobSettings() |
Properties
| Property | Type | Description |
|---|---|---|
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 Signature | Returns | Description |
|---|---|---|
# Apply(string zpl) | string | Inserts ZplJobSettings.ToZpl after every ^XA of zpl (assumes the default ^ caret). |
# ToZpl() | string | The 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).
public sealed class ZplPrinterClientSends ZPL to a network printer (raw TCP, port 9100) or any stream (USB/serial adapters).
Constructors
| Signature | Description |
|---|---|
# ZplPrinterClient(string host, int port = 9100) | Sends ZPL to a network printer (raw TCP, port 9100) or any stream (USB/serial adapters). |
Properties
| Property | Type | Description |
|---|---|---|
Encoding { get; set; } | Encoding | Encoding 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 Signature | Returns | Description |
|---|---|---|
# AsConnection() | IPrinterConnection | This 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) | Task | Writes ZPL to an arbitrary stream (file, serial port, USB device handle). |
# SendBytesAsync(byte[] data, CancellationToken ct = default) | Task | Sends 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…
public enum ZplPrinterErrorsError 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]
| Name | Value | Description |
|---|---|---|
None | 0 | |
MediaOut | 0x1 | |
RibbonOut | 0x2 | |
HeadOpen | 0x4 | |
CutterFault | 0x8 | |
PrintheadOverTemperature | 0x10 | |
MotorOverTemperature | 0x20 | |
BadPrintheadElement | 0x40 | |
PrintheadDetectionError | 0x80 | |
InvalidFirmwareConfiguration | 0x100 | |
PrintheadThermistorOpen | 0x200 | |
PaperJam | 0x1000 | Paper jam during retract (KR403). |
PresenterNotRunning | 0x2000 | Presenter not running (KR403). |
PaperFeedError | 0x4000 | Paper feed error (KR403). |
ClearPaperPathFailed | 0x8000 | Clear paper path failed (KR403). |
Paused | 0x10000 | The printer is paused. |
RetractTimedOut | 0x20000 | Retract function timed out (KR403). |
BlackMarkCalibrateError | 0x40000 | Black mark calibrate error (KR403). |
BlackMarkNotFound | 0x80000 | Black mark not found (KR403). |
ZplPrinterFaults
Scriptable faults and printer conditions of a ZplVirtualPrinter: set conditions now (ZplPrinterFaults.Raise), schedule them det…
public sealed class ZplPrinterFaultsScriptable 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
| Property | Type | Description |
|---|---|---|
Active { get; } | IReadOnlyCollection<ZplFaultKind> | Active conditions. |
Scheduled { get; } | IReadOnlyList<ZplFaultRule> | Scheduled rules that have not fired yet (and repeating rules). |
Seed { get; set; } | int | Seed of the random triggers (default 0): the same seed and job give the same faults. |
StopsPrinting { get; } | bool | Printing is stopped (paper/ribbon out, head open, over temperature, cutter fault, pause, power off). |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# ActiveRule(ZplFaultKind kind) | ZplFaultRule | The rule that activated kind (null when raised without rule or inactive). |
# Clear(ZplFaultKind kind) | void | Clears a condition (paper loaded, head closed, cooled down, ~PS for Pause ...). |
# ClearAll() | void | Clears all conditions and removes all scheduled rules. |
# IsActive(ZplFaultKind kind) | bool | |
# Load(ZplChaosScript script) | void | Loads a chaos script (see ZplChaosScript) and schedules its faults. |
# Raise(ZplFaultKind kind) | void | Activates a condition now (like a sensor or the operator). |
# Schedule(ZplFaultRule rule) | ZplFaultRule | Schedules a rule; ZplFaultTriggerKind.Immediately activates it at once. |
# Schedule(ZplFaultKind kind, ZplFaultTrigger trigger) | ZplFaultRule |
Events
| Event | Handler Type | Description |
|---|---|---|
FaultCleared | EventHandler<ZplFaultEventArgs> | |
FaultRaised | EventHandler<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…
public record ZplPrinterStatusParsed ~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
| Signature | Description |
|---|---|
# 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
| Property | Type | Description |
|---|---|---|
BufferFull { get; init; } | bool | f: receive buffer full. |
CorruptRam { get; init; } | bool | j: corrupt RAM (configuration data lost). |
FormatsInBuffer { get; init; } | int | |
GraphicsStored { get; init; } | int | www: number of graphic images stored in memory. |
HeadOpen { get; init; } | bool | |
IsReady { get; } | bool | |
LabelLength { get; init; } | int | dddd: label length in dots. |
LabelWaiting { get; init; } | bool | t: label waiting (peel-off mode). |
LabelsRemainingInBatch { get; init; } | int | |
OverTemperature { get; init; } | bool | |
PaperOut { get; init; } | bool | |
PartialFormat { get; init; } | bool | h: partial format in progress (a format was started but its ^XZ has not arrived). |
Paused { get; init; } | bool | |
PrintModeCode { get; init; } | string | r: 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; } | bool | q: thermal transfer mode selected. |
UnderTemperature { get; init; } | bool |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# 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) | ZplPrinterStatus | Parses 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).
public enum ZplPrinterWarningsWarning flags of the ~HQES response (nibbles 8-1), ~HQ Table 9 "Warning Flags" (sensor flags: KR403).
Values [Flags]
| Name | Value | Description |
|---|---|---|
None | 0 | |
NeedToCalibrateMedia | 0x1 | |
CleanPrinthead | 0x2 | |
ReplacePrinthead | 0x4 | |
PaperNearEnd | 0x8 | |
Sensor1PaperBeforeHead | 0x10 | Sensor 1 (paper before head). |
Sensor2BlackMark | 0x20 | Sensor 2 (black mark). |
Sensor3PaperAfterHead | 0x40 | Sensor 3 (paper after head). |
Sensor4LoopReady | 0x80 | Sensor 4 (loop ready). |
Sensor5Presenter | 0x100 | Sensor 5 (presenter). |
Sensor6RetractReady | 0x200 | Sensor 6 (retract ready). |
Sensor7InRetract | 0x400 | Sensor 7 (in retract). |
Sensor8AtBin | 0x800 | Sensor 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…
public sealed class ZplVirtualPrinter : IAsyncDisposableVirtual 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.
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
| Signature | Description |
|---|---|
# 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
| Property | Type | Description |
|---|---|---|
ConcurrentConnections { get; set; } | bool | Process 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; } | ZplPrinterFaults | Printer 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; } | TimeSpan | Closes a connection without data for this long (default 60 s). |
IsRunning { get; } | bool | |
LabelPrintTime { get; set; } | TimeSpan | Time 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; } | int | Upper bound of buffered unprocessed data per connection (default 64 MB). |
MemoryBytes { get; set; } | long | Printer memory for downloads (~DG, ~DY, ~DU, ^DF) per connection in bytes; 0 = default of ZplResourceStore.MaxTotalBytes. Reported by ~HM. |
Model { get; set; } | string | Model reported by ~HI. |
OutputDirectory { get; set; } | string | When set, each rendered label is saved here ("label-yyyyMMdd-HHmmss-n.png"). |
Port { get; } | int | The bound port (valid after ZplVirtualPrinter.Start). |
Profile { get; } | PrinterProfile | The profile applied with ZplVirtualPrinter.ApplyProfile, null for the generic virtual printer. |
ReceiveBufferBytes { get; set; } | int | Receive 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; } | ZplRenderSettings | Render settings used for each new connection (dpi, label size, output format PNG/PDF/..., ZplRenderSettings.CutterInstalled). |
RfidSimulator { get; set; } | ZplRfidSimulator | RFID 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; } | bool | No ~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; } | TimeProvider | Clock 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 Signature | Returns | Description |
|---|---|---|
# ApplyProfile(PrinterProfile profile) | ZplVirtualPrinter | Makes 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() | ZplVirtualPrinterStatus | Snapshot 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
| Event | Handler Type | Description |
|---|---|---|
Error | EventHandler<Exception> | Raised when a connection fails (bad data, renderer errors, IO); the listener keeps running. |
JobReceived | EventHandler<VirtualJobEventArgs> | |
LabelCut | EventHandler<VirtualCutEventArgs> | The cutter cut after a label (cutter, delayed cut with ~JK, kiosk ^CN, RFID void with ^PQ e). |
LabelDropped | EventHandler<VirtualLabelEventArgs> | A label was lost (ZplFaultKind.DropLabels): rendered but not printed. |
LabelReceived | EventHandler<VirtualLabelEventArgs> |
ZplVirtualPrinterStatus
Snapshot of the simulated printer (ZplVirtualPrinter.GetStatus).
public record ZplVirtualPrinterStatusSnapshot of the simulated printer (ZplVirtualPrinter.GetStatus).
Constructors
| Signature | Description |
|---|---|
# 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
| Property | Type | Description |
|---|---|---|
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 Signature | Returns | Description |
|---|---|---|
# 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 typesRendered element trace, pixel comparison (ImageCompare), and vector output capture.
BitmapFont
Downloaded bitmap font (~DB): fixed-size glyph bitmaps, magnified by integer factors.
public sealed class BitmapFontDownloaded bitmap font (~DB): fixed-size glyph bitmaps, magnified by integer factors.
Constructors
| Signature | Description |
|---|---|
# BitmapFont() |
Properties
| Property | Type | Description |
|---|---|---|
Baseline { get; init; } | int | |
Glyphs { get; } | Dictionary<int, BitmapFont.Glyph> | |
Height { get; init; } | int | |
SpaceWidth { get; init; } | int | |
Width { get; init; } | int |
BitmapFont.Glyph
public record BitmapFont.GlyphConstructors
| Signature | Description |
|---|---|
# Glyph(int Height, int Width, int OffsetX, int OffsetY, int Advance, byte[] Bits) |
Properties
| Property | Type | Description |
|---|---|---|
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 Signature | Returns | Description |
|---|---|---|
# 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.
FontManager
Maps ZPL font identifiers (0, A–Z, ^CW aliases, downloaded TTFs) to Skia typefaces. Zebra's resident fonts are proprietary, so …
public sealed class FontManagerMaps 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.
ZplResourceStore.Fonts.Constructors
| Signature | Description |
|---|---|
# FontManager() |
Properties
| Property | Type | Description |
|---|---|---|
static DefaultMono { get; } | SKTypeface | Built-in monospace font (barcode texts, EPL/ZPL bitmap font replacement). |
static DefaultSans { get; } | SKTypeface | Built-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; } | SKTypeface | Typeface for the bitmap fonts A–H without a registered TTF. |
Scalable { get; set; } | SKTypeface | Typeface for font 0 and other scalable fonts without a registered TTF. |
SystemFonts { get; set; } | bool | Resolve 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 Signature | Returns | Description |
|---|---|---|
static # Convert(byte[] ttf, string name, FontDownloadCommand command = FontDownloadCommand.DY) | string | Converts 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) | void | Registers a downloaded bitmap font (~DB) under a name like "R:MYFONT.FNT". |
# RegisterFolder(string directory) | void | Registers every *.ttf/*.otf of a folder; the file name (e.g. "0.ttf", "ARIAL.TTF") is the font name. |
# RegisterFont(string name, byte[] ttf) | void | Registers 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) | bool | Renames 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).
public static class ImageCompareTolerant comparison of rendered labels (e.g. against reference renders of a real printer).
Methods
| Method Signature | Returns | Description |
|---|---|---|
static # Compare(SKBitmap expected, SKBitmap actual, int tolerance = 2) | ImageComparison | Precision = 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) | SKBitmap | Overlay: black = both, red = only expected, blue = only actual. |
ImageComparison
Result of comparing two black/white label images.
public record ImageComparisonResult of comparing two black/white label images.
Constructors
| Signature | Description |
|---|---|
# ImageComparison(double Precision, double Recall, int OnlyA, int OnlyB, int InkA, int InkB) | Result of comparing two black/white label images. |
Properties
| Property | Type | Description |
|---|---|---|
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; } | double | Harmonic mean of precision and recall (1 = identical within tolerance). |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# Deconstruct(out double Precision, out double Recall, out int OnlyA, out int OnlyB, out int InkA, out int InkB) | void |
ZplCore.Rfid #
23 typesRFID 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…
public sealed class EpcAn 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
| Property | Type | Description |
|---|---|---|
AidcDataBits { get; } | string | Bits after the EPC when Epc.HasAidcData (not decoded; null otherwise). |
Binary { get; } | string | Exact binary encoding ('0'/'1', header first) without padding. |
BitLength { get; } | int | Length of Epc.Binary in bits. |
CompanyPrefix { get; } | string | The 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; } | string | DSGTIN+: the prioritised date YYMMDD. |
DateAi { get; } | string | DSGTIN+: AI of the prioritised date ("11", "13", "15", "16", "17", "7006" or "7007"). |
DigitalLinkUri { get; } | string | GS1 Digital Link URI on id.gs1.org (Gs1DigitalLink.Build), e.g. "https://id.gs1.org/01/09506000134352/21/6789". |
ElementString { get; } | string | GS1 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; } | int | Filter value 0–7 (control information, not part of the EPC identity; TDS §10). |
FilterName { get; } | string | Meaning of Epc.Filter for this key (TDS Tables 10-1 to 10-5), e.g. "Point of Sale (POS) Trade Item". |
Giai { get; } | string | GIAI, AI (8004). |
Gln { get; } | string | GLN (13 digits) of an SGLN. |
GlnExtension { get; } | string | GLN extension, AI (254); null for an SGLN without extension (encoded as extension "0", TDS §7.5). |
Grai { get; } | string | GRAI without serial: the 14 digits after AI (8003) (leading pad '0', company prefix, asset type, check digit). |
Gtin { get; } | string | GTIN-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; } | string | The 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; } | EpcKeyType | The GS1 key. |
PureIdentityUri { get; } | string | EPC 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; } | EpcScheme | The binary coding scheme. |
SchemeInfo { get; } | EpcSchemeInfo | Header, TDS name and length of Epc.Scheme. |
Serial { get; } | string | Serial number: AI (21) of an SGTIN, serial component of a GRAI (null for other keys). |
Sscc { get; } | string | SSCC (18 digits). |
TagUri { get; } | string | EPC 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; } | int | Number of 16-bit words the EPC occupies in the EPC memory bank from bit 20h (PC length field). |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# ConvertTo(EpcScheme scheme, int? filter = default) | Epc | The same identity in another scheme (e.g. SGTIN-96 → SGTIN+), with an optional new filter value. |
# Equals(object obj) | bool | Same scheme, filter and binary encoding. |
# GetHashCode() | int | |
# PcWord(bool userMemoryIndicator = false) | ushort | Protocol 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) | string | Pure Identity URI with an explicit company prefix length (6–12; 4 and 5 are treated as 6). |
# ToString() | string | Tag URI when defined, else the element string with the scheme name. |
EpcError
Why an EPC could not be encoded or decoded (EpcException.Error).
public enum EpcErrorWhy an EPC could not be encoded or decoded (EpcException.Error).
Values
| Name | Value | Description |
|---|---|---|
InvalidInput | 0 | The input is empty or not in the expected form. |
InvalidElementString | 1 | The GS1 element string is invalid (format, check digit, characters; see the message). |
MissingElement | 2 | A GS1 key the scheme needs is missing (e.g. (21) for an SGTIN). |
InvalidCompanyPrefixLength | 3 | The GS1 Company Prefix length is missing or not 6 to 12 (4 and 5 are treated as 6, TDS §7.1). |
InvalidFilter | 4 | The filter value is not 0 to 7. |
GtinNotAllowed | 5 | TDS 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). |
ValueOutOfRange | 6 | A serial, extension or asset reference does not fit the scheme (numeric only, no leading zero, value range, length). |
InvalidCharacter | 7 | A character outside the set the scheme can encode (GS1 character set 82, TDS Table A-1). |
InvalidDate | 8 | A date for DSGTIN+ is missing, ambiguous or invalid (TDS §14.5.3). |
UnknownHeader | 9 | The binary encoding has a header that TDS does not assign, or a scheme this library does not decode. |
Truncated | 10 | The binary encoding is shorter than the scheme needs. |
InvalidBinary | 11 | A binary field holds a value TDS does not allow (partition 7, digits above 10^L, reserved bits not zero …). |
InvalidHex | 12 | The hexadecimal string contains other characters than 0-9 A-F. |
InvalidUri | 13 | The 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.
public sealed class EpcException : FormatExceptionAn EPC could not be encoded or decoded; EpcException.Error says why, the message names the field and value.
Constructors
| Signature | Description |
|---|---|
# 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
EpcFilters
Filter values of TDS §10 (Tables 10-1 to 10-5).
public static class EpcFiltersFilter values of TDS §10 (Tables 10-1 to 10-5).
Methods
| Method Signature | Returns | Description |
|---|---|---|
static # IsReserved(EpcKeyType key, int filter) | bool | True for filter values TDS marks "Reserved" (encoders SHOULD NOT write them, TDS §10.1). |
static # Name(EpcKeyType key, int filter) | string | Meaning of a filter value; "Reserved" for values TDS reserves. |
EpcKeyType
The GS1 key an EPC scheme identifies.
EpcScheme
EPC binary coding schemes of the GS1 EPC Tag Data Standard (TDS) 2.3 that ZplRfid encodes and decodes. The fixed-length schemes…
public enum EpcSchemeEPC 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
| Name | Value | Description |
|---|---|---|
Sgtin96 | 0 | SGTIN-96 (header 30h): GTIN + numeric serial without leading zeros, below 2^38 (TDS §14.6.1.1). |
Sgtin198 | 1 | SGTIN-198 (header 36h): GTIN + serial of up to 20 characters of GS1 character set 82 (TDS §14.6.1.2). |
SgtinPlus | 2 | SGTIN+ (header F7h): GTIN in 4-bit digits + variable-length serial, no company prefix length needed (TDS §14.6.1.3). |
DsgtinPlus | 3 | DSGTIN+ (header FBh): SGTIN+ with a prioritised date (11), (13), (15), (16), (17), (7006) or (7007) (TDS §14.6.1.4). |
Sscc96 | 4 | SSCC-96 (header 31h, TDS §14.6.2.1). |
SsccPlus | 5 | SSCC+ (header F9h, 84 bits, TDS §14.6.2.2). |
Sgln96 | 6 | SGLN-96 (header 32h): GLN + numeric extension below 2^41 (TDS §14.6.3.1). |
Sgln195 | 7 | SGLN-195 (header 39h): GLN + extension of up to 20 characters (TDS §14.6.3.2). |
SglnPlus | 8 | SGLN+ (header F2h, TDS §14.6.3.3). |
Grai96 | 9 | GRAI-96 (header 33h): GRAI with numeric serial below 2^38 (TDS §14.6.4.1). |
Grai170 | 10 | GRAI-170 (header 37h): GRAI with serial of up to 16 characters (TDS §14.6.4.2). |
GraiPlus | 11 | GRAI+ (header F1h, TDS §14.6.4.3). |
Giai96 | 12 | GIAI-96 (header 34h): numeric individual asset reference (TDS §14.6.5.1). |
Giai202 | 13 | GIAI-202 (header 38h): alphanumeric individual asset reference (TDS §14.6.5.2). |
GiaiPlus | 14 | GIAI+ (header FAh, TDS §14.6.5.3). |
EpcSchemeInfo
Static data of an EpcScheme: header, name, bit length.
public record EpcSchemeInfoStatic data of an EpcScheme: header, name, bit length.
Constructors
| Signature | Description |
|---|---|
# 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
| Property | Type | Description |
|---|---|---|
static All { get; } | IReadOnlyList<EpcSchemeInfo> | All supported schemes. |
Bits { get; init; } | int | Encoded length in bits, or 0 for variable-length "+" schemes. |
Header { get; init; } | byte | 8-bit EPC header (TDS Table 14-1). |
IsPlus { get; } | bool | A TDS 2.0 "+" scheme (no Tag URI, no partition, +AIDC data toggle bit). |
Key { get; init; } | EpcKeyType | The GS1 key. |
Name { get; init; } | string | Name as in TDS Table 14-1 and in the Tag URI, e.g. "sgtin-96", "sgtin+". |
Scheme { get; init; } | EpcScheme | The scheme. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
static # ByHeader(byte header) | EpcSchemeInfo | Scheme by header byte, or null when TDS assigns no supported scheme to it. |
static # ByName(string name) | EpcSchemeInfo | Scheme 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) | EpcSchemeInfo | Info of scheme. |
static # OtherSchemeName(byte header) | string | TDS 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.
RfidEncodeOptions
Options of ZplRfid.BuildCommands (each null value omits its command).
public sealed class RfidEncodeOptionsOptions of ZplRfid.BuildCommands (each null value omits its command).
Constructors
| Signature | Description |
|---|---|
# RfidEncodeOptions() |
Properties
| Property | Type | Description |
|---|---|---|
AccessPassword { get; set; } | string | Access 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; } | string | Header text of the ^HV response (default "EPC:"); ^FH escapes are applied when it needs them. |
KillPassword { get; set; } | string | Kill 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; } | RfidPcMode | PC 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; } | bool | Write 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; } | string | User 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.
public record RfidHostResponseAn ^HV host verification response.
Constructors
| Signature | Description |
|---|---|
# 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
| Property | Type | Description |
|---|---|---|
FieldNumber { get; init; } | int | The ^FN number it reports. |
PerLabel { get; init; } | bool | a = L: one response per label (else F: once per format). |
Text { get; init; } | string | Header + data (first n characters) + terminator, as sent to the host. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# Deconstruct(out int FieldNumber, out string Text, out bool PerLabel) | void |
RfidLabelResult
Outcome of encoding one label's tag (ZplRfidSimulator.Encode).
public sealed class RfidLabelResultOutcome of encoding one label's tag (ZplRfidSimulator.Encode).
Constructors
| Signature | Description |
|---|---|
# RfidLabelResult() |
Properties
| Property | Type | Description |
|---|---|---|
Epc { get; init; } | Epc | The EPC on the tag after the operations, decoded (null when it is not a valid EPC). |
Error { get; init; } | string | The first failure (null on success). |
HostResponses { get; init; } | IReadOnlyList<RfidHostResponse> | ^HV responses of this label. |
LabelIndex { get; init; } | int | 0-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; } | bool | All operations succeeded and every write read back correctly; false: the printer voids the label. |
Tag { get; init; } | RfidTag | The tag after the operations (null when there was none). |
VoidedLabels { get; init; } | int | Labels the printer voided for this label (ZplRfidSimulator.Simulate; includes the last try when it failed). |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# ToString() | string |
RfidLockState
Lock state of a password or memory bank (Gen2 Lock command, ^RLM / ^RZ).
public enum RfidLockStateLock state of a password or memory bank (Gen2 Lock command, ^RLM / ^RZ).
Values
| Name | Value | Description |
|---|---|---|
Unlocked | 0 | Writable (passwords readable) in the open and secured state. |
Locked | 1 | Writable (passwords readable) only in the secured state, i.e. with the right access password. |
PermaUnlocked | 2 | Permanently unlocked: always writable, can never be locked. |
PermaLocked | 3 | Permanently locked: never writable (passwords never readable). |
RfidLockTarget
What a lock applies to (^RLM k,a,e,u; ^RZ m).
public enum RfidLockTargetWhat a lock applies to (^RLM k,a,e,u; ^RZ m).
Values
| Name | Value | Description |
|---|---|---|
KillPassword | 0 | |
AccessPassword | 1 | |
Epc | 2 | |
User | 3 |
RfidOperationResult
One simulated RFID command and its outcome.
public record RfidOperationResultOne simulated RFID command and its outcome.
Constructors
| Signature | Description |
|---|---|
# 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
| Property | Type | Description |
|---|---|---|
Command { get; init; } | string | ZPL as written, e.g. "^RFW,H,,,A". |
Message { get; init; } | string | What happened (bank, word, bytes, data read …). |
Offset { get; init; } | int | Source offset of the command or field (-1 when unknown). |
Status { get; init; } | RfidTagStatus | Tag status (Success when the command needs no tag or succeeded). |
Success { get; } | bool |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# 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).
public readonly record struct RfidPcThe protocol control (PC) word of the EPC memory bank, bits 10h–1Fh (TDS §9.3, Gen2).
Constructors
| Signature | Description |
|---|---|
# 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
| Property | Type | Description |
|---|---|---|
AttributeBits { get; } | int | Attribute bits (toggle 0) or AFI (toggle 1), bits 18h–1Fh. |
EpcWords { get; } | int | Length field L4–L0 (bits 10h–14h): number of 16-bit EPC words from bit 20h. |
Toggle { get; } | bool | Numbering system toggle (bit 17h): false = GS1 EPC, true = ISO UII with AFI. |
UserMemoryIndicator { get; } | bool | User memory indicator (bit 15h). |
Value { get; init; } | ushort | The 16-bit word. |
XpcIndicator { get; } | bool | XPC_W1 indicator (bit 16h). |
Methods
RfidPcMode
How the ^RF command writes the EPC and the protocol control (PC) length bits.
public enum RfidPcModeHow the ^RF command writes the EPC and the protocol control (PC) length bits.
Values
| Name | Value | Description |
|---|---|---|
Auto | 0 | ^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. |
Keep | 1 | ^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). |
Explicit | 2 | ^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).
public sealed class RfidPrinterSettingsPersistent RFID settings of the simulated printer (^RS, ^RR, ^RW; RFID Programming Guide 3).
Constructors
| Signature | Description |
|---|---|
# RfidPrinterSettings() |
Properties
| Property | Type | Description |
|---|---|---|
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…
public sealed class RfidTagSimulated 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
| Signature | Description |
|---|---|
# 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
| Property | Type | Description |
|---|---|---|
AccessPassword { get; } | uint | Access password (reserved bank words 2–3). |
EpcHex { get; } | string | The EPC as announced by the PC length bits, in hex. |
FailingWrites { get; set; } | int | The next n write operations fail (simulates a weak or damaged tag; the printer retries with ^RR). |
KillPassword { get; } | uint | Kill password (reserved bank words 0–1). |
LockAccessPassword { get; } | RfidLockState | |
LockEpc { get; } | RfidLockState | |
LockKillPassword { get; } | RfidLockState | |
LockTid { get; } | RfidLockState | TID lock (permalocked by the tag manufacturer). |
LockUser { get; } | RfidLockState | |
Pc { get; } | RfidPc | StoredPC (EPC bank word 1). |
Profile { get; } | RfidTagProfile | Memory sizes. |
Silent { get; set; } | bool | The tag does not answer (no tag at the antenna, dead tag). |
StoredCrc { get; } | ushort | StoredCRC (EPC bank word 0): CRC-16 over PC and EPC words (Gen2, see RfidTag.Crc16). |
TidHex { get; } | string | TID bank in hex. |
UserHex { get; } | string | User memory in hex. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# Bank(RfidBank bank) | byte[] | Whole bank contents (a copy). |
static # Crc16(ReadOnlySpan<byte> data) | ushort | Gen2 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() | Epc | The decoded EPC, or null when the EPC bank holds no valid EPC (see ZplRfid.TryDecodeEpc). |
# Lock(RfidLockTarget target, RfidLockValue action, uint? accessPassword = default) | RfidTagStatus | Gen2 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) | RfidTagStatus | Permanently 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) | RfidTagStatus | Writes 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.
public record RfidTagProfileMemory sizes of a simulated tag.
Constructors
| Signature | Description |
|---|---|
# RfidTagProfile() |
Properties
| Property | Type | Description |
|---|---|---|
ComputedUmi { get; init; } | bool | The tag computes the UMI bit from user memory (Gen2v2 tags); false: UMI as written. |
static Epc128User512 { get; } | RfidTagProfile | A tag with a 128-bit EPC area and 512 bits of user memory. |
static Epc96 { get; } | RfidTagProfile | A tag with a 96-bit EPC area and no user memory. |
EpcBits { get; init; } | int | Bits of the EPC area from bit 20h (96 to 496; default 496 = largest a PC length can announce). |
InitialPc { get; init; } | ushort | PC word of a blank tag (default 3000h: 96-bit EPC announced, as shipped by most inlay vendors). |
UserBits { get; init; } | int | Bits of user memory (0 = none; default 512). |
UserSections { get; init; } | int | Number of permalockable user memory sections (^RLB); default 8. |
RfidTagStatus
Result code of a simulated tag operation (after the Gen2 tag error codes).
public enum RfidTagStatusResult code of a simulated tag operation (after the Gen2 tag error codes).
Values
| Name | Value | Description |
|---|---|---|
Success | 0 | |
NoTag | 1 | No tag in the field (the printer voids the label). |
MemoryOverrun | 2 | The operation addresses words beyond the end of the bank (Gen2 "memory overrun"). |
MemoryLocked | 3 | The bank or password is locked and the access password does not open it (Gen2 "memory locked"). |
WrongPassword | 4 | The access password presented does not match the tag's. |
WriteFailed | 5 | The write did not reach the tag (weak tag, RfidTag.FailingWrites). |
VerifyFailed | 6 | Read-back after a write returned other data. |
OtherError | 7 | Other 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 …
public static class ZplRfidRFID 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 Signature | Returns | Description |
|---|---|---|
static # BuildCommands(Epc epc, RfidEncodeOptions? options = default) | string | ZPL 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) | ComplianceReport | RFID 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) | Epc | Decodes 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) | Epc | Decodes 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) | Epc | Decodes 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) | Epc | Encodes 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) | Epc | Encodes 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) | Epc | Encodes 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) | Epc | SGLN 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) | Epc | SGTIN 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) | Epc | SSCC-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) | Epc | Parses 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) | RfidItem | A 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) | bool | ZplRfid.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 …
public record ZplRfidCommandOne 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
| Signature | Description |
|---|---|
# 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
| Property | Type | Description |
|---|---|---|
Command { get; init; } | string | Command name without prefix: "RF", "RB", "RS", "HV" …; "FN" for a non-RFID field with a field number. |
Data { get; init; } | string | Resolved 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; } | int | Length of the field's source block (up to ^FS) or of the command. |
Offset { get; init; } | int | Source offset of the field (its first command) or of the command; -1 when unknown. |
Parameters { get; init; } | string | Raw parameters of the command. |
Methods
ZplRfidSimulator
RFID tag simulation: executes the RFID commands of a label (^RF write/read/passwords, ^RQ, ^RZ, ^RLM/^RLB, ^RS, ^RR, ^RW, ^HV) …
public sealed class ZplRfidSimulatorRFID 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.
Constructors
| Signature | Description |
|---|---|
# ZplRfidSimulator() |
Properties
| Property | Type | Description |
|---|---|---|
ReportResults { get; set; } | bool | ~RV E / D: report "_+,n_" / "_-,n_" after each label (default false). |
Settings { get; } | RfidPrinterSettings | Persistent ^RS / ^RR / ^RW state (updated by the commands of every label). |
TagProfile { get; set; } | RfidTagProfile | Memory 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 Signature | Returns | Description |
|---|---|---|
# ApplySettings(IReadOnlyList<ZplRfidCommand> commands) | void | Applies 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) | RfidLabelResult | Executes one label's RFID commands on tag (one encoding attempt). |
# NextTag() | RfidTag | The 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 typesDigital 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).
public record ScanProofCoverageDecoder coverage of one symbology (see ZplScanProof.Coverage).
Constructors
| Signature | Description |
|---|---|
# 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
| Property | Type | Description |
|---|---|---|
Decodable { get; } | bool | At least one decoder reads it; otherwise only structural checks are made. |
GeneratorSymbology { get; init; } | string | Matching Symbology value(s) of the stand-alone generator, comma separated ("" if none). |
Kind { get; init; } | ScanProofSymbolKind | Measurement and grading model. |
QuietZone { get; init; } | string | Required quiet zone in modules ("10X", "11X/7X", "—" when no requirement is checked). |
Symbology { get; init; } | string | Symbology name. |
ZplCommand { get; init; } | string | ZPL command ("^BC"), or "" for symbologies of the stand-alone generator only. |
ZxingCpp { get; init; } | bool | zxing-cpp decodes it. |
ZxingNet { get; init; } | bool | ZXing.Net decodes it. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# 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.
public enum ScanProofDataStatusHow a symbol's decoded data compares with the data the field asks for.
Values
| Name | Value | Description |
|---|---|---|
Match | 0 | Decoded data equals the expected data (and the field data as written). |
DataAltered | 1 | Decoded 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). |
Mismatch | 2 | A decoder read the symbol, but the data differs from the expected data. |
NotDecoded | 3 | The symbology is supported by an available decoder, but no decoder could read the rendered symbol. |
NotDecodable | 4 | No available decoder supports this symbology: only the structural checks were made. |
NotRendered | 5 | The field was not drawn at all (invalid data etc.; see the render diagnostics). |
Unverified | 6 | A 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.
public record ScanProofDecoderInfoInformation about one decoder backend.
Constructors
| Signature | Description |
|---|---|
# 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
| Property | Type | Description |
|---|---|---|
Available { get; init; } | bool | The decoder could be loaded on this platform. |
License { get; init; } | string | SPDX licence identifier. |
Name { get; init; } | string | "zxing-cpp" or "ZXing.Net". |
Reason { get; init; } | string | Why it is unavailable (null when available). |
Version { get; init; } | string | Package version. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# 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).
public record ScanProofDecoderResultResult of one decoder for one symbol (or one component of a composite symbol).
Constructors
| Signature | Description |
|---|---|
# ScanProofDecoderResult() |
Properties
| Property | Type | Description |
|---|---|---|
Component { get; init; } | string | Symbol component ("" for a single symbol; "Code 39" / "MicroPDF417" for TLC39). |
Data { get; init; } | string | Decoded data (FNC1 separators as GS U+001D; GS1 data in raw form), null when not decoded. |
Decoded { get; init; } | bool | The decoder read the symbol on the rendered label. |
required Decoder { get; init; } | string | Decoder 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; } | bool | The 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; } | bool | The decoder supports this symbology. |
SymbologyIdentifier { get; init; } | string | Symbology 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).
public record ScanProofFindingOne message about a symbol. ScanProofFinding.Code is stable (see docs-internal/scan-proof.md).
Constructors
| Signature | Description |
|---|---|
# 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
| Property | Type | Description |
|---|---|---|
Code { get; init; } | string | Stable identifier, e.g. "SP1001". |
Message { get; init; } | string | Human-readable text (may change between versions). |
Severity { get; init; } | ScanProofSeverity | How serious the finding is. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# 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…
public enum ScanProofGradeLetter 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
ScanProofParameter
One graded parameter.
public record ScanProofParameterOne graded parameter.
Constructors
| Signature | Description |
|---|---|
# 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
| Property | Type | Description |
|---|---|---|
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; } | string | Parameter name ("Symbol contrast", "Quiet zone" …). |
Note { get; init; } | string | Short 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 Signature | Returns | Description |
|---|---|---|
# 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.
public enum ScanProofQuietZoneLimitWhat ends a quiet zone measured on the bitmap.
Values
ScanProofQuietZones
Quiet zones measured on the rendered label, in printer dots and in modules (X).
public record ScanProofQuietZonesQuiet zones measured on the rendered label, in printer dots and in modules (X).
Constructors
| Signature | Description |
|---|---|
# ScanProofQuietZones() |
Properties
| Property | Type | Description |
|---|---|---|
Bottom { get; init; } | double | |
BottomDots { get; init; } | int | |
BottomLimit { get; init; } | ScanProofQuietZoneLimit | |
Left { get; init; } | double | Clear space in modules (dots / X). |
LeftDots { get; init; } | int | Clear space found (dots); for linear symbols the minimum over the scan lines. |
LeftLimit { get; init; } | ScanProofQuietZoneLimit | |
RequiredBottom { get; init; } | double | |
RequiredLeft { get; init; } | double | Required 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; } | bool | Top/bottom quiet zones apply (2D and stacked symbols). |
ScanProofRect
Axis-aligned rectangle on the label in dots.
public record ScanProofRectAxis-aligned rectangle on the label in dots.
Constructors
| Signature | Description |
|---|---|
# ScanProofRect(int X, int Y, int Width, int Height) | Axis-aligned rectangle on the label in dots. |
Properties
| Property | Type | Description |
|---|---|---|
Height { get; init; } | int | |
Width { get; init; } | int | |
X { get; init; } | int | |
Y { get; init; } | int |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# Deconstruct(out int X, out int Y, out int Width, out int Height) | void |
ScanProofReport
Result of ZplScanProof.Verify: one entry per barcode symbol.
public sealed class ScanProofReportResult of ZplScanProof.Verify: one entry per barcode symbol.
Constructors
| Signature | Description |
|---|---|
# ScanProofReport() |
Properties
| Property | Type | Description |
|---|---|---|
Decoders { get; init; } | IReadOnlyList<ScanProofDecoderInfo> | |
Disclaimer { get; } | string | Always 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; } | bool | Any symbol whose data is wrong or unreadable (ScanProofSymbol.IsDataProblem). |
LabelCount { get; init; } | int | Labels 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; } | int | Identical ^PQ copies that were not checked again. |
Symbols { get; init; } | IReadOnlyList<ScanProofSymbol> |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# ToJson(bool indented = true) | string | The report as JSON (camelCase, enums as strings, nulls omitted). |
# ToSarif(string? artifactUri = default) | string | The 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() | string | Human-readable summary (one block per symbol). |
ScanProofRobustnessCheck
Outcome of one robustness simulation (heuristic, not a print physics model).
public record ScanProofRobustnessCheckOutcome of one robustness simulation (heuristic, not a print physics model).
Constructors
| Signature | Description |
|---|---|
# 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
| Property | Type | Description |
|---|---|---|
Detail { get; init; } | string | What was simulated. |
Name { get; init; } | string | Degradation, e.g. "bar gain +1 dot". |
Passed { get; init; } | bool | At least one decoder still read the expected data. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# Deconstruct(out string Name, out bool Passed, out string Detail) | void |
ScanProofSeverity
Severity of a ScanProofFinding.
ScanProofSymbol
Scan-proof result for one barcode symbol on one label.
public record ScanProofSymbolScan-proof result for one barcode symbol on one label.
Constructors
| Signature | Description |
|---|---|
# ScanProofSymbol() |
Properties
| Property | Type | Description |
|---|---|---|
BarHeightDots { get; init; } | double? | Bar height (linear) or symbol height (2D) in dots and millimetres. |
BarHeightMm { get; init; } | double? | |
ClippedPixels { get; init; } | int | Pixels 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; } | string | ZPL command, e.g. "^BC". |
DecodedData { get; init; } | string | Data read back from the rendered bitmap (first decoder that read it), null when not decoded. |
Decoders { get; init; } | IReadOnlyList<ScanProofDecoderResult> | |
ExpectedData { get; init; } | string | Data 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; } | bool | The expected data is GS1 data (FNC1 in first position). |
FieldData { get; init; } | string | Field 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; } | int | Grey (anti-aliased) pixels inside the symbol area. |
Height { get; init; } | int | |
HumanReadable { get; init; } | string | Interpretation 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; } | int | 0-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; } | bool | Data is wrong or unreadable: ScanProofDataStatus.Mismatch, ScanProofDataStatus.DataAltered, ScanProofDataStatus.NotDecoded or ScanProofDataStatus.NotRendered. |
Kind { get; init; } | ScanProofSymbolKind | |
LabelIndex { get; init; } | int | 0-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; } | int | Pixels 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; } | int | Rotation 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; } | int | Field block in the ZPL source (offset/length, 1-based line/column; -1/0 when unknown). |
Status { get; init; } | ScanProofDataStatus | |
SymbolBounds { get; init; } | ScanProofRect | The 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; } | string | Symbology 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; } | int | Logical 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.
public enum ScanProofSymbolKindKind of symbol, which decides the measurements and the grading model.
Values
| Name | Value | Description |
|---|---|---|
Linear | 0 | Single-row bar code (ISO/IEC 15416 model). |
Stacked | 1 | Multi-row symbol (PDF417, MicroPDF417, Codablock F, Code 49, DataBar stacked). |
Matrix | 2 | Matrix symbol (QR, Data Matrix, Aztec; ISO/IEC 15415 model). |
MaxiCode | 3 | MaxiCode (hexagonal modules). |
Postal | 4 | Height-modulated or 4-state postal code. |
Composite | 5 | Two linked symbols (TLC39: Code 39 with MicroPDF417). |
ZplCore.Testing #
31 typesFluent 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.
public sealed class BarcodeAssertions : ElementAssertions<BarcodeAssertions, ComplianceBarcode>Assertions on one barcode: scan-proof (decode, grade, quiet zones) and measured geometry.
Properties
| Property | Type | Description |
|---|---|---|
Symbol { get; } | ScanProofSymbol | The scan-proof result of this barcode (decoders, grade, quiet zones, findings); null when not found. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# Decodes() | BarcodeAssertions | Decoders read the barcode back from the render, with the data its field asks for. |
# Decodes(string expected) | BarcodeAssertions | Decoders 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) | BarcodeAssertions | Linear barcodes: the bar height is at least atLeastMm mm. |
# HasGrade(char atLeast) | BarcodeAssertions | The digital pre-check grade (modelled on ISO/IEC 15416/15415) is at least atLeast ('A'–'D'). |
# HasGrade(ScanProofGrade atLeast) | BarcodeAssertions | The digital pre-check grade is at least atLeast. |
# HasQuietZones() | BarcodeAssertions | The quiet zones (clear space before and after the symbol) are at least what the symbology requires. |
# HasXDimension(double minMm, double maxMm = 1.7976931348623157E+308) | BarcodeAssertions | The measured X-dimension (narrowest bar or module) is between minMm and maxMm. |
# IsGs1(string? ai = default, string? value = default) | BarcodeAssertions | The barcode carries GS1 element strings (FNC1 first) – optionally with AI ai = value. |
# IsSymbology(ComplianceSymbology symbology) | BarcodeAssertions | The 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…
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
| Property | Type | Description |
|---|---|---|
And { get; } | LabelAssertions | Back to the label for more assertions. |
Element { get; } | TElement | The selected element (null when the selection failed inside a scope). |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# DoesNotOverlap(string other) | TSelf | The element's ink does not overlap any element matched by other (text content or barcode selector). |
# DoesNotOverlapAnything() | TSelf | The element's ink does not overlap any other element. |
# IsAbove(string other) | TSelf | The element ends above the top of every element matched by other. |
# IsAt(double xMm, double yMm, double toleranceMm = 0.5) | TSelf | The element's top-left corner is at (xMm, yMm) ± toleranceMm. |
# IsBelow(string other) | TSelf | The element starts below the bottom of every element matched by other. |
# IsInside(double xMm, double yMm, double widthMm, double heightMm) | TSelf | The element lies completely inside the area (mm from the top-left label corner). |
# IsWithinLabel(double marginMm = 0) | TSelf | The element lies completely on the label, at least marginMm from every edge. |
ElementChange
A semantic difference between two renders of a label.
public record ElementChangeA semantic difference between two renders of a label.
Constructors
| Signature | Description |
|---|---|
# ElementChange(ElementChangeKind Kind, int LabelIndex, SnapshotElement Before, SnapshotElement After, string Description) | A semantic difference between two renders of a label. |
Properties
| Property | Type | Description |
|---|---|---|
After { get; init; } | SnapshotElement | |
Before { get; init; } | SnapshotElement | |
Description { get; init; } | string | |
IsContentChange { get; } | bool | Added, removed and content changes – changes a pixel tolerance must not hide. |
Kind { get; init; } | ElementChangeKind | |
LabelIndex { get; init; } | int |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# Deconstruct(out ElementChangeKind Kind, out int LabelIndex, out SnapshotElement Before, out SnapshotElement After, out string Description) | void |
ElementChangeKind
Kind of a ElementChange.
public enum ElementChangeKindKind of a ElementChange.
Values
| Name | Value | Description |
|---|---|---|
Added | 0 | A new element. |
Removed | 1 | An element is gone. |
ContentChanged | 2 | Same element, text or data changed. |
Moved | 3 | Same 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…
public interface IZplPrinterFitExtension 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
| Property | Type | Description |
|---|---|---|
Name { get; } | string | Printer name for messages ("ZD421 203 dpi"). |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# 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…
public sealed class LabelAssertionsFluent 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
| Property | Type | Description |
|---|---|---|
Current { get; } | ComplianceLabel | The 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; } | ScanProofReport | The scan-proof report of the job (every barcode decoded back, measured and graded). |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# AllBarcodesDecode() | LabelAssertions | Every barcode decodes back to the data its field asks for (scan-proof, two independent decoders). |
# AllBarcodesHaveGrade(char atLeast) | LabelAssertions | Every graded barcode reaches at least grade atLeast (A–D) in the digital pre-check. |
# Barcode(string selector, int? index = default) | BarcodeAssertions | Selects 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 = "") | BarcodeAssertions | Selects the barcode that satisfies predicate (exactly one). |
# Complies(CompliancePacks packs, ComplianceSeverity failOn = ComplianceSeverity.Error) | LabelAssertions | Runs compliance rule packs and fails on findings of failOn or above (default errors). |
# Complies(ComplianceRulePack pack, ComplianceSeverity failOn = ComplianceSeverity.Error) | LabelAssertions | Runs compliance rule packs (built-in or custom) and fails on findings of failOn or above. |
# DoesNotHaveText(string text) | LabelAssertions | No text field of the label contains text (e.g. "TODO", "{{", placeholder data). |
# FieldEquals(int fieldNumber, string expected) | LabelAssertions | The field with ^FNfieldNumber prints expected. |
# FieldEquals(string field, string expected) | LabelAssertions | The field "FN1" / "^FN1" / "1" prints expected (data as drawn, after ^FH, ^SN and field values). |
# FitsPrinter(PrinterProfile profile, bool failOnWarnings = false) | LabelAssertions | The 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) | LabelAssertions | The 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) | LabelAssertions | The label has exactly count barcodes. |
# HasLabels(int count) | LabelAssertions | The job prints exactly count label formats (^XA…^XZ; ^PQ copies count once). |
# HasText(string text) | LabelAssertions | Some text field of the label contains text. |
# MatchesSnapshot(string name, double tolerancePercent) | LabelAssertions | Pixel snapshot with tolerancePercent % changed pixels allowed (see LabelAssertions.MatchesSnapshot). |
# MatchesSnapshot(string name, SnapshotTolerance? tolerance = default) | LabelAssertions | Compares 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() | LabelAssertions | Every element lies completely on the label (nothing cut off at the ^PW/^LL edge). |
# NoOverlaps(int toleranceDots = 0) | LabelAssertions | No 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) | LabelAssertions | Switches to label index (0-based, print order; ^PQ copies are not separate labels). |
# Renders(int? dpi = default, ZplDiagnosticSeverity failOn = ZplDiagnosticSeverity.Warning) | LabelAssertions | The 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 = "") | LabelAssertions | Custom assertion on the current label. |
# Text(string text, int? index = default) | TextAssertions | Selects 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.
public record PrinterFitContextWhat a printer-fit check sees: the ZPL, the resolution it was rendered at and every measured label.
Constructors
| Signature | Description |
|---|---|
# 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
| Property | Type | Description |
|---|---|---|
DefaultLabelLengthMm { get; init; } | double? | Label length used when the ZPL sets no ^LL (null: the checker's default). |
Dpi { get; init; } | int | Resolution 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; } | string | The ZPL under test. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# Deconstruct(out string Zpl, out int Dpi, out IReadOnlyList<ComplianceLabel> Labels) | void |
PrinterFitIssue
A reason why a label does not fit a printer.
public record PrinterFitIssueA reason why a label does not fit a printer.
Constructors
| Signature | Description |
|---|---|
# 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
| Property | Type | Description |
|---|---|---|
Code { get; init; } | string | Stable id, e.g. "ZT1201" (built-in) or the id of the profile's own rule. |
Element { get; init; } | ComplianceElement | The element that does not fit, if any. |
LabelIndex { get; init; } | int | 0-based label, -1 for the whole job. |
Message { get; init; } | string | What does not fit. |
Severity { get; init; } | ZplDiagnosticSeverity | Error fails LabelAssertions.FitsPrinter; warnings fail only with failOnWarnings. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# 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 …
public sealed class PrinterProfileFit : IZplPrinterFitA 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
| Signature | Description |
|---|---|
# 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
| Property | Type | Description |
|---|---|---|
Name { get; } | string | |
Profile { get; } | PrinterProfile | The wrapped profile. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# Check(PrinterFitContext context) | IEnumerable<PrinterFitIssue> | |
# ToString() | string |
PrinterProfileFitExtensions
PrinterProfile helpers for the assertions.
public static class PrinterProfileFitExtensionsPrinterProfile helpers for the assertions.
Methods
| Method Signature | Returns | Description |
|---|---|---|
extension # AsPrinterFit(this PrinterProfile profile, ZplTwinOptions? options = default) | IZplPrinterFit | The 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…
public sealed class PrinterSpec : IZplPrinterFitData-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
| Signature | Description |
|---|---|
# 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
| Property | Type | Description |
|---|---|---|
Dpi { get; } | int | Printhead resolution. |
MaxLabelLengthMm { get; } | double? | Maximum label length in mm (null: not limited). |
Name { get; } | string | |
PrintWidthMm { get; } | double | Maximum print width in mm. |
Fields & Constants
| Field | Type | Description |
|---|---|---|
const LabelLengthRule = "ZT1203" | string | Built-in rule ids. |
const PrintWidthRule = "ZT1202" | string | Built-in rule ids. |
const ResolutionRule = "ZT1201" | string | Built-in rule ids. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# Check(PrinterFitContext context) | IEnumerable<PrinterFitIssue> | |
# ToString() | string |
SemanticDiff
Element-level diff of two renders (used by snapshots and by zplcore check --baseline).
public static class SemanticDiffElement-level diff of two renders (used by snapshots and by zplcore check --baseline).
Methods
| Method Signature | Returns | Description |
|---|---|---|
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…
public record SnapshotDocumentSemantic 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
| Signature | Description |
|---|---|
# SnapshotDocument() |
Properties
| Property | Type | Description |
|---|---|---|
Dpi { get; init; } | int | Resolution of the render. |
Engine { get; init; } | string | zplCore version that wrote the snapshot. |
Format { get; init; } | string | Format marker ("zplcore-snapshot"). |
Labels { get; init; } | IReadOnlyList<SnapshotLabel> | The labels with their elements. |
SourceSha256 { get; init; } | string | SHA-256 of the ZPL source (informational: the snapshot compares the render, not the source). |
Version { get; init; } | int | Format version (1). |
Methods
| Method Signature | Returns | Description |
|---|---|---|
static # FromJson(string json) | SnapshotDocument | Reads a snapshot document; null when the JSON is not one. |
# ToJson() | string | Indented JSON (camelCase). |
SnapshotElement
One element of a semantic snapshot: what was drawn where (dots), independent of the pixels.
public record SnapshotElementOne element of a semantic snapshot: what was drawn where (dots), independent of the pixels.
Constructors
| Signature | Description |
|---|---|
# 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
| Property | Type | Description |
|---|---|---|
Command { get; init; } | string | ZPL command with prefix, e.g. "^A0", "^BC", "^GB". |
Content { get; init; } | string | Text as printed, barcode data as the scanner reads it (control characters as ‹GS›), shape/graphic parameters. |
Height { get; init; } | int | Height in dots. |
Kind { get; init; } | string | text, barcode, shape, graphic or other. |
Label { get; } | string | "text "FROM"", "barcode ^BC Code128 "(00)…"". |
Line { get; init; } | int | 1-based ZPL source line (0 when unknown). |
Symbology { get; init; } | string | Barcode symbology (barcodes only). |
Width { get; init; } | int | Width in dots. |
X { get; init; } | int | Left edge in dots. |
Y { get; init; } | int | Top edge in dots. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# 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.
public record SnapshotLabelOne label of a semantic snapshot.
Constructors
| Signature | Description |
|---|---|
# SnapshotLabel(int Index, int Width, int Height, string Image, IReadOnlyList<SnapshotElement> Elements) | One label of a semantic snapshot. |
Properties
| Property | Type | Description |
|---|---|---|
Elements { get; init; } | IReadOnlyList<SnapshotElement> | |
Height { get; init; } | int | |
Image { get; init; } | string | |
Index { get; init; } | int | |
Width { get; init; } | int |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# 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.
public record SnapshotLabelResultComparison result of one label of a snapshot.
Constructors
| Signature | Description |
|---|---|
# SnapshotLabelResult() |
Properties
| Property | Type | Description |
|---|---|---|
AllowedPixels { get; init; } | long | Changed pixels the tolerance allows for this label. |
ApprovedPath { get; init; } | string | Approved image path. |
Area { get; init; } | long | Label area in pixels. |
ChangedPercent { get; } | double | Changed pixels in percent of the label area. |
ChangedPixels { get; init; } | long | Changed pixels after the shift tolerance. |
DiffPath { get; init; } | string | Diff overlay path (written on failure): grey unchanged, red removed, green added, blue boxes around changed regions. |
Index { get; init; } | int | 0-based label index. |
Passed { get; init; } | bool | Within tolerance. |
ReceivedPath { get; init; } | string | Received image path (written on failure). |
Regions { get; init; } | IReadOnlyList<ZplDiffRegion> | Changed regions (largest first). |
SizeChange { get; init; } | string | Approved and received label sizes differ ("812 × 1218 → 812 × 1200"), else null. |
SnapshotOutcome
Outcome of a snapshot comparison.
public enum SnapshotOutcomeOutcome of a snapshot comparison.
Values
SnapshotResult
Result of SnapshotStore.Verify.
public record SnapshotResultResult of SnapshotStore.Verify.
Constructors
| Signature | Description |
|---|---|
# SnapshotResult() |
Properties
| Property | Type | Description |
|---|---|---|
ApprovedJsonPath { get; init; } | string | Path 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; } | string | Approved / received label counts differ. |
Labels { get; init; } | IReadOnlyList<SnapshotLabelResult> | Per-label comparison. |
required Name { get; init; } | string | Snapshot name (file-safe). |
Outcome { get; init; } | SnapshotOutcome | Outcome. |
Passed { get; } | bool | Match or accepted. |
SnapshotStore
Snapshot folder with the approval workflow. Files per snapshot name: name.approved.png (label 1), name.label2.approved.png … – …
public sealed class SnapshotStoreSnapshot 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
| Signature | Description |
|---|---|
# SnapshotStore(string directory) | Opens (and creates on write) the folder. |
Properties
| Property | Type | Description |
|---|---|---|
Directory { get; } | string | Absolute folder path. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
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) | string | File name of label index's image ("approved", "received" or "diff"). |
static # SafeName(string name) | string | Makes 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) | SnapshotResult | Compares 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.
public record SnapshotSubjectWhat a snapshot stores for a render: one PNG per label and the semantic document.
Constructors
| Signature | Description |
|---|---|
# SnapshotSubject(IReadOnlyList<byte[]> Pngs, SnapshotDocument Document) | What a snapshot stores for a render: one PNG per label and the semantic document. |
Properties
| Property | Type | Description |
|---|---|---|
Document { get; init; } | SnapshotDocument | |
Pngs { get; init; } | IReadOnlyList<byte[]> |
Methods
| Method Signature | Returns | Description |
|---|---|---|
static # Create(IReadOnlyList<byte[]> pngs, IReadOnlyList<ComplianceLabel> labels, int dpi, string zpl, string name) | SnapshotSubject | Builds 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…
public record SnapshotToleranceHow 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
| Signature | Description |
|---|---|
# SnapshotTolerance() |
Properties
| Property | Type | Description |
|---|---|---|
static Exact { get; } | SnapshotTolerance | Pixel-identical, no content change. |
IgnoreContentChanges { get; init; } | bool | Accept added/removed/changed elements as long as the pixel tolerance holds (default false). |
MaxChangedPercent { get; init; } | double | Changed pixels that are accepted, in percent of the label area (0–100). |
MaxChangedPixels { get; init; } | int | Changed pixels that are accepted (absolute). |
ShiftPixels { get; init; } | int | Ink that moved by up to this many dots counts as unchanged (anti-jitter for cross-platform font rasterising). |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# Allowed(long area) | long | Allowed changed pixels for a label of area pixels. |
static # Percent(double percent) | SnapshotTolerance | Up to percent % changed pixels. |
static # Pixels(int pixels) | SnapshotTolerance | Up to pixels changed pixels. |
# WithShift(int dots) | SnapshotTolerance | Ignores ink that moved by up to dots dots. |
TextAssertions
Assertions on one text field.
public sealed class TextAssertions : ElementAssertions<TextAssertions, ComplianceText>Assertions on one text field.
Methods
| Method Signature | Returns | Description |
|---|---|---|
# HasCharHeight(double atLeastMm) | TextAssertions | The measured character (cap/digit) height is at least atLeastMm mm. |
# HasContent(string expected) | TextAssertions | The field prints exactly expected. |
ZplAssert
Entry point of the semantic label assertions. ZplAssert.Label(zpl) renders the label once and returns a fluent LabelAssertions …
public static class ZplAssertEntry 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
| Property | Type | Description |
|---|---|---|
static Settings { get; } | ZplAssertSettings | Process-wide defaults (snapshot folder, failure images, exception adapter). Set them once, e.g. in a module initializer. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
static # Label(string zpl, ZplTestOptions? options = default) | LabelAssertions | Starts 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) | LabelAssertions | Starts assertions on a label model (Label), converted with Label.ToZpl at the test resolution. |
static # LabelFile(string path, ZplTestOptions? options = default) | LabelAssertions | Starts assertions on a .zpl file or a label JSON file (Label.FromJson). |
ZplAssertSettings
Process-wide defaults for ZplAssert.
public sealed class ZplAssertSettingsProcess-wide defaults for ZplAssert.
Constructors
| Signature | Description |
|---|---|
# ZplAssertSettings() |
Properties
| Property | Type | Description |
|---|---|---|
AcceptSnapshots { get; set; } | bool | Accept 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; } | int | Default 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; } | bool | Fail 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; } | string | Folder of the failure images (default: zplcore-failures in the test output folder, or the folder in ZplAssertSettings.FailureDirectoryEnvironmentVariable). |
HeightMm { get; set; } | double | Default label height in mm when the ZPL has no ^LL (6 in). |
SnapshotDirectory { get; set; } | string | Folder for snapshots, relative to the test source file (default __snapshots__ next to the test class) or absolute. |
SnapshotTolerance { get; set; } | SnapshotTolerance | Default pixel tolerance of LabelAssertions.MatchesSnapshot (exact). |
WidthMm { get; set; } | double | Default label width in mm when the ZPL has no ^PW (4 in). |
WriteFailureImages { get; set; } | bool | Write an annotated PNG for every failure (failing elements outlined) and put its path into the message. Default on. |
Fields & Constants
| Field | Type | Description |
|---|---|---|
const AcceptEnvironmentVariable = "ZPLCORE_ACCEPT_SNAPSHOTS" | string | Environment variable that accepts snapshots: 1/true writes every received snapshot as approved. |
const FailureDirectoryEnvironmentVariable = "ZPLCORE_FAILURE_DIR" | string | Environment 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…
public sealed class ZplAssertionException : ExceptionThrown 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
| Signature | Description |
|---|---|
# ZplAssertionException(IReadOnlyList<ZplAssertionFailure> failures) | Creates the exception for one or more failures. |
Properties
| Property | Type | Description |
|---|---|---|
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…
public record ZplAssertionFailureOne 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
| Signature | Description |
|---|---|
# ZplAssertionFailure() |
Properties
| Property | Type | Description |
|---|---|---|
ApprovedPath { get; init; } | string | Snapshot assertions: the approved image the label was compared with. |
required Assertion { get; init; } | string | The assertion chain that failed, e.g. Barcode("SSCC").Decodes("(00)…"). |
Column { get; init; } | int | 1-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; } | string | Snapshot assertions: overlay of approved and received (black = both, red = only approved, blue = only received). |
ImagePath { get; init; } | string | The label rendered with the failing elements outlined (red) and related elements (orange), or null. |
LabelIndex { get; init; } | int | 0-based label index (print order), -1 when the failure is not tied to one label. |
Line { get; init; } | int | 1-based ZPL source line of the failing element (0 when unknown). |
ReceivedPath { get; init; } | string | Snapshot assertions: the image the label renders now (written next to the approved one). |
required Summary { get; init; } | string | One-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…
public sealed class ZplAssertionScope : IDisposableCollects 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
| Signature | Description |
|---|---|
# ZplAssertionScope() | Opens a scope (nested scopes report to the outermost one). |
Properties
| Property | Type | Description |
|---|---|---|
Failures { get; } | IReadOnlyList<ZplAssertionFailure> | Failures collected so far. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# Dispose() | void | Closes the scope and throws when assertions failed. |
ZplPrinterFit
Factory helpers for IZplPrinterFit.
public static class ZplPrinterFitFactory helpers for IZplPrinterFit.
Methods
| Method Signature | Returns | Description |
|---|---|---|
static # From(string name, Func<PrinterFitContext, IEnumerable<PrinterFitIssue>> check) | IZplPrinterFit | Wraps 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.
public static class ZplSelectorsHow LabelAssertions.Barcode and LabelAssertions.Text find elements. The first rule that matches anything wins.
#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
| Property | Type | Description |
|---|---|---|
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 …
public static class ZplTestFrameworksOptional 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.
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
| Property | Type | Description |
|---|---|---|
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.
public record ZplTestOptionsPer-label settings of ZplAssert.Label. Unset values come from ZplAssert.Settings.
Constructors
| Signature | Description |
|---|---|
# ZplTestOptions() |
Properties
| Property | Type | Description |
|---|---|---|
AcceptSnapshots { get; init; } | bool? | Accept snapshots of this label (overrides ZplAssertSettings.AcceptSnapshots). |
Clock { get; init; } | DateTime | Clock 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; } | string | Failure 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; } | bool | Run the scan-proof robustness simulations (slower) for barcode assertions. |
SnapshotDirectory { get; init; } | string | Snapshot 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 typesBatch 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.
CheckCase
One check of a file (a JUnit test case).
public record CheckCaseOne check of a file (a JUnit test case).
Constructors
| Signature | Description |
|---|---|
# CheckCase(string Name, CheckStatus Status, IReadOnlyList<CheckFinding> Findings, double Seconds, string? Message = default) | One check of a file (a JUnit test case). |
Properties
| Property | Type | Description |
|---|---|---|
Findings { get; init; } | IReadOnlyList<CheckFinding> | |
Message { get; init; } | string | |
Name { get; init; } | string | |
Seconds { get; init; } | double | |
Status { get; init; } | CheckStatus |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# 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.
public record CheckFindingOne finding of zplcore check with its source position.
Constructors
| Signature | Description |
|---|---|
# CheckFinding() |
Properties
| Property | Type | Description |
|---|---|---|
Bounds { get; init; } | ComplianceRect? | Area on the label in dots. |
required Check { get; init; } | string | Check that reported it ("render", "layout", "comply gs1-logistic", "scan-proof", "snapshot", "printer", "baseline"). |
Column { get; init; } | int | 1-based column (0 when unknown). |
LabelIndex { get; init; } | int | 0-based label, -1 for the file. |
Length { get; init; } | int | Length of the source span (0 when unknown). |
Line { get; init; } | int | 1-based line (0 when unknown). |
required Message { get; init; } | string | Human-readable message, prefixed with the label number. |
Offset { get; init; } | int | Character offset into the ZPL (-1 when unknown). |
required RuleId { get; init; } | string | Rule id: ZPL3xxx (compliance), SPxxxx (scan-proof), ZTxxxx (testing: render, layout, snapshot, baseline, printer). |
required Severity { get; init; } | CheckSeverity | Severity. |
Suggestion { get; init; } | string | Optional fix suggestion. |
CheckImages
Rendered images of one label for the report (paths relative to ZplCheckOptions.ReportDirectory).
public record CheckImagesRendered images of one label for the report (paths relative to ZplCheckOptions.ReportDirectory).
Constructors
| Signature | Description |
|---|---|
# 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
| Property | Type | Description |
|---|---|---|
After { get; init; } | string | |
Before { get; init; } | string | |
ChangedPixels { get; init; } | long | |
Diff { get; init; } | string | |
LabelIndex { get; init; } | int |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# 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).
CheckStatus
Result of one check (a JUnit test case).
public enum CheckStatusResult of one check (a JUnit test case).
Values
| Name | Value | Description |
|---|---|---|
Passed | 0 | No finding at or above ZplCheckOptions.FailOn. |
Failed | 1 | Findings at or above ZplCheckOptions.FailOn. |
Error | 2 | The check could not run (input error, exception). |
Skipped | 3 | Not run (e.g. JSON that is no label). |
CheckedFile
Everything zplcore check found for one file.
public sealed class CheckedFileEverything zplcore check found for one file.
Constructors
| Signature | Description |
|---|---|
# CheckedFile() |
Properties
| Property | Type | Description |
|---|---|---|
Baseline { get; init; } | BaselineState | Comparison 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; } | bool | A 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; } | int | Number of labels the file prints. |
required Path { get; init; } | string | Absolute path. |
required RelativePath { get; init; } | string | Path relative to the root, with forward slashes (SARIF artifact URI, JUnit suite name). |
Seconds { get; init; } | double | Time spent on the file. |
Skipped { get; init; } | bool | Label JSON that is no label (e.g. package.json): skipped. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# Count(CheckSeverity s) | int | Number of findings of severity s. |
LabelSource
Reads label files for ZplCheck: ZPL (.zpl, .prn, .txt …) and label JSON (Label.FromJson).
public static class LabelSourceReads label files for ZplCheck: ZPL (.zpl, .prn, .txt …) and label JSON (Label.FromJson).
Properties
| Property | Type | Description |
|---|---|---|
static DefaultPatterns { get; } | IReadOnlyList<string> | Default patterns of zplcore check without arguments. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
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) | bool | True when json is a label JSON object (items, width, height). |
static # Load(string path, int dpi) | string | Loads 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) | string | Decodes 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.
public sealed class MarkdownOptionsOptions of ZplCheckResult.ToMarkdown.
Constructors
| Signature | Description |
|---|---|
# MarkdownOptions() |
Properties
| Property | Type | Description |
|---|---|---|
ArtifactUrl { get; set; } | string | Link to the uploaded report artifact / workflow run, shown when images are left out. |
DetailsForUnchanged { get; set; } | bool | Show 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; } | string | Hidden marker that identifies the comment for updates (<!-- zplcore-label-check -->). |
MaxLength { get; set; } | int | Maximum characters (GitHub comments allow 65 536). |
Title { get; set; } | string | Heading. |
ZplCheck
The label check runner behind zplcore check: renders every label file, runs the selected checks (render, layout, compliance pac…
public static class ZplCheckThe 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
| Field | Type | Description |
|---|---|---|
const MaxImagesPerFile = 4 | int | At most this many labels per file get report images. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
static # CheckFile(string path, string root, ZplCheckOptions options) | CheckedFile | Checks one file. |
static # Run(ZplCheckOptions options) | ZplCheckResult | Runs all checks on the files matched by ZplCheckOptions.Inputs. |
static # SnapshotName(string relativePath) | string | Snapshot 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.
public static class ZplCheck.RulesRule ids of the testing checks (ZT…). Compliance (ZPL3xxx) and scan-proof (SPxxxx) keep their own ids.
Properties
| Property | Type | Description |
|---|---|---|
static All { get; } | IReadOnlyList<(string, string, string, CheckSeverity)> | Id, name, description and default level of every ZT rule (SARIF rule metadata). |
Fields & Constants
| Field | Type | Description |
|---|---|---|
const BaselineAdded = "ZT3002" | string | New label file. |
const BaselineChanged = "ZT3001" | string | The label changed against the baseline. |
const Clipped = "ZT1102" | string | An element extends beyond the label edge. |
const GradeBelowMinimum = "ZT1301" | string | A barcode grade is below ZplCheckOptions.MinGrade. |
const LoadFailed = "ZT1000" | string | The file could not be read or converted. |
const NoLabel = "ZT1002" | string | The file prints no label. |
const Overlap = "ZT1101" | string | Ink of two elements overlaps. |
const RenderDiagnostic = "ZT1001" | string | Render diagnostic (warning/error). |
const SnapshotContentChanged = "ZT2003" | string | Elements added, removed or changed against the snapshot. |
const SnapshotMismatch = "ZT2001" | string | The render differs from the approved snapshot. |
const SnapshotMissing = "ZT2002" | string | No approved snapshot. |
const SnapshotUpdated = "ZT2004" | string | The 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…
public static class ZplCheckCommandCommand 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
| Field | Type | Description |
|---|---|---|
const Usage = "zplcore check – semantic label check…" | string | Help text of zplcore check --help. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
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) | int | Runs check/test/snapshot with args (the command name first). Returns the exit code. |
ZplCheckOptions
Options of ZplCheck.Run (the zplcore check command line).
public sealed class ZplCheckOptionsOptions of ZplCheck.Run (the zplcore check command line).
Constructors
| Signature | Description |
|---|---|
# ZplCheckOptions() |
Properties
| Property | Type | Description |
|---|---|---|
BaselineDirectory { get; set; } | string | Folder 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; } | int | Print 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; } | double | Label 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; } | bool | Check overlaps (ZT1101) and clipping (ZT1102). |
LayoutSeverity { get; set; } | CheckSeverity | Severity 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; } | IZplPrinterFit | Printer to check against (ZT1201–ZT1203 or the implementation's ids). |
ReportDirectory { get; set; } | string | Folder for before/after/diff PNGs of changed files and the report files. |
Root { get; set; } | string | Root for patterns and relative paths in reports (default: current directory). |
SnapshotDirectory { get; set; } | string | Snapshot folder: compare every file with its approved snapshot (name = relative path). |
SnapshotTolerance { get; set; } | SnapshotTolerance | Pixel tolerance of the snapshot comparison. |
UpdateSnapshots { get; set; } | bool | Write the current renders as approved snapshots instead of comparing. |
Verify { get; set; } | bool | Run scan-proof: decode every barcode, measure, grade. |
WidthMm { get; set; } | double | Label width when the ZPL has no ^PW (default 4 in). |
ZplCheckResult
Result of ZplCheck.Run with the CI output formats.
public sealed class ZplCheckResultResult of ZplCheck.Run with the CI output formats.
Properties
| Property | Type | Description |
|---|---|---|
ChangedFiles { get; } | int | Files that changed against the baseline or are new. |
ExitCode { get; } | int | Process exit code: 0 passed, 1 failed. |
Failed { get; } | bool | True when any check failed (findings at ZplCheckOptions.FailOn or above, or a check error). |
FailedFiles { get; } | int | Files 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; } | ZplCheckOptions | The options of the run. |
Root { get; } | string | Absolute root the relative paths refer to. |
Seconds { get; } | double | Duration of the run. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# Count(CheckSeverity s) | int | Number of findings of severity s. |
# ToGitHubAnnotations() | string | GitHub Actions workflow commands (::error file=…,line=…::…): inline annotations without code scanning. |
# ToJUnit() | string | JUnit 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() | string | Machine-readable result (files, cases, findings, changes, images). |
# ToMarkdown(MarkdownOptions? options = default) | string | Markdown 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() | string | SARIF 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() | string | Console text: one block per file, findings as path:line:col: error RULE: message (compiler style, works with problem matchers). |
ZplCore.Tools #
17 typesZPL developer tools: ZplFormatter, semantic ZplDiff, ZplRescaler (DPI conversion), and ZplGs1Migration (1D to 2D Sunrise 2027).
Gs1LabelMigration
Result for one label.
public sealed class Gs1LabelMigrationResult for one label.
Properties
| Property | Type | Description |
|---|---|---|
Carrier { get; } | Gs1MigrationCarrier | Carrier that was (or would be) added. |
DigitalLinkUri { get; } | string | The GS1 Digital Link URI (QR Code carrier) or null. |
ElementString { get; } | string | The 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; } | string | The ZPL field that was inserted (null when nothing was added). |
LabelIndex { get; } | int | 0-based label index in print order. |
Message { get; } | string | One-line summary. |
ModuleDots { get; } | int | Module size in dots and mm. |
ModuleMm { get; } | double | |
Placement { get; } | string | Where the symbol was placed relative to the linear barcode, e.g. "right of ^BE, top-aligned". |
QuietZoneDots { get; } | int | Quiet zone of the 2D symbol in dots (4X for QR Code, 1X for Data Matrix). |
Source { get; } | Gs1MigrationSource | The 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 Signature | Returns | Description |
|---|---|---|
# ToString() | string |
Gs1LabelMigrationStatus
Outcome for one label.
public enum Gs1LabelMigrationStatusOutcome for one label.
Values
| Name | Value | Description |
|---|---|---|
Migrated | 0 | The 2D carrier was added. |
AlreadyMigrated | 1 | The label already has a GS1 DataMatrix or a Digital Link QR Code / Data Matrix with the same GTIN. |
NoGtinCarrier | 2 | No EAN/UPC, GS1-128 with (01), ITF-14 or GS1 DataBar with a GTIN was found; nothing to migrate. |
NoSpace | 3 | No free area with the required quiet zone; see Gs1LabelMigration.Suggestions. |
Conflict | 4 | The barcodes on the label carry different GTINs, or the data cannot be encoded. |
Unsupported | 5 | The 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.
public enum Gs1MigrationCarrier2D carrier that ZplGs1Migration adds next to the linear barcode.
Values
| Name | Value | Description |
|---|---|---|
QrCodeDigitalLink | 0 | QR Code (^BQ, model 2) with an uncompressed GS1 Digital Link URI (no FNC1): readable by POS scanners and phones. |
DataMatrixElementString | 1 | GS1 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.
public enum Gs1MigrationNoSpaceActionWhat ZplGs1Migration does when the label has no free area for the 2D carrier.
Values
| Name | Value | Description |
|---|---|---|
Report | 0 | Leave the label unchanged and report the space needed and the options (default). |
ExtendLabel | 1 | Make the label longer (^LL) and put the 2D carrier below the existing content (needs longer label stock). |
Gs1MigrationOptions
Settings of ZplGs1Migration.Migrate.
public sealed class Gs1MigrationOptionsSettings of ZplGs1Migration.Migrate.
Constructors
| Signature | Description |
|---|---|
# Gs1MigrationOptions() |
Properties
| Property | Type | Description |
|---|---|---|
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; } | Gs1MigrationCarrier | 2D carrier to add (default QR Code with GS1 Digital Link URI). |
CarryAllAis { get; set; } | bool | Carry every AI found on the label (overrides Gs1MigrationOptions.CarriedAis). |
ClearanceMm { get; set; } | double | Minimum distance in mm between the 2D symbol and other printing (at least its quiet zone; default 1 mm). |
DefaultLabelHeightMm { get; set; } | double | Label height in mm when the ZPL has no ^LL (default 152.4 mm). |
DefaultLabelWidthMm { get; set; } | double | Label width in mm when the ZPL has no ^PW (default 101.6 mm). |
DigitalLinkStem { get; set; } | string | Domain (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; } | int | Print resolution in dpi (default 203); all mm values are computed with it. |
EdgeMarginMm { get; set; } | double | Minimum 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; } | Gs1MigrationNoSpaceAction | What to do when no free area is found (default Gs1MigrationNoSpaceAction.Report). |
ModuleMm { get; set; } | double | Target 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; } | char | QR Code error correction level L, M, Q or H (default M). Ignored for Data Matrix. |
Gs1MigrationResult
Result of ZplGs1Migration.Migrate.
public sealed class Gs1MigrationResultResult of ZplGs1Migration.Migrate.
Properties
| Property | Type | Description |
|---|---|---|
Changed { get; } | bool | |
Dpi { get; } | int | |
Labels { get; } | IReadOnlyList<Gs1LabelMigration> | |
MigratedZpl { get; } | string | The ZPL with the added 2D carriers (equal to Gs1MigrationResult.OriginalZpl when nothing was added). |
OriginalZpl { get; } | string | |
Success { get; } | bool | Every 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; } | ComplianceReport | The "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
| Field | Type | Description |
|---|---|---|
const Disclaimer = "GS1 2D migration assistant (pre-chec…" | string | Wording used in every output: an assistant and pre-check, not a certification. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
static # StatusName(Gs1LabelMigrationStatus s) | string | Display name of a status ("migrated", "no GTIN carrier" …). |
# ToJson(bool indented = true) | string | JSON report (labels, inserted ZPL, URI, placement in dots and mm, the sunrise check findings). |
# ToString() | string | |
# ToText(string? fileName = default) | string | Human-readable report. |
Gs1MigrationSource
The linear GTIN carrier a migration is based on.
public record Gs1MigrationSourceThe linear GTIN carrier a migration is based on.
Constructors
| Signature | Description |
|---|---|
# 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
| Property | Type | Description |
|---|---|---|
Command { get; init; } | string | ZPL command, e.g. "^BE". |
Elements { get; init; } | IReadOnlyList<Gs1Element> | All GS1 elements it encodes (GTIN only for EAN/UPC/ITF-14). |
Gtin { get; init; } | string | The 14-digit GTIN it encodes. |
IsRetailPos { get; } | bool | EAN/UPC or GS1 DataBar (scanned at retail POS); GS1-128 and ITF-14 are not. |
Line { get; init; } | int | 1-based source line. |
Name { get; init; } | string | Display name, e.g. "EAN-13". |
SymbolBounds { get; init; } | ComplianceRect | Bars in dots. |
Symbology { get; init; } | ComplianceSymbology | Its symbology (EAN-13, UPC-A, EAN-8, UPC-E, GS1-128, ITF-14, GS1 DataBar). |
VariableData { get; init; } | bool | The data comes from ^FN / ^SN / ^SF (a template field). |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# 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…
public static class ZplDiffCompares 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 Signature | Returns | Description |
|---|---|---|
static # Compare(string zplA, string zplB, ZplRenderSettings? settings = default, ZplDiffOptions? options = default) | ZplDiffResult | Renders zplA and zplB with settings and compares them. |
static # CompareImages(SKBitmap a, SKBitmap b, ZplDiffOptions? options = default, int index = 0) | ZplLabelDiff | Pixel 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).
public record ZplDiffLineOne line of a text diff; ZplDiffLine.LineA/ZplDiffLine.LineB are 1-based (null when the line is not in that side).
Constructors
| Signature | Description |
|---|---|
# 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
| Property | Type | Description |
|---|---|---|
Kind { get; init; } | ZplDiffLineKind | |
LineA { get; init; } | int? | |
LineB { get; init; } | int? | |
Text { get; init; } | string |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# Deconstruct(out ZplDiffLineKind Kind, out string Text, out int? LineA, out int? LineB) | void |
ZplDiffLineKind
Kind of a line in ZplDiffResult.TextDiff.
ZplDiffOptions
Options of ZplDiff.Compare.
public sealed class ZplDiffOptionsOptions of ZplDiff.Compare.
Constructors
| Signature | Description |
|---|---|
# ZplDiffOptions() |
Properties
| Property | Type | Description |
|---|---|---|
FormatText { get; set; } | bool | Pretty-print both sides before the text diff, so layout-only changes vanish (default true). |
IncludeOverlay { get; set; } | bool | Encode an overlay PNG per label (default true). |
MaxRegions { get; set; } | int | Maximum number of regions reported per label (default 50). |
OutlineRegions { get; set; } | bool | Draw a box around each changed region into the overlay (default false). |
ZplDiffRegion
Bounding box (in dots) of a group of changed pixels.
public record ZplDiffRegionBounding box (in dots) of a group of changed pixels.
Constructors
| Signature | Description |
|---|---|
# ZplDiffRegion(int X, int Y, int Width, int Height, int ChangedPixels) | Bounding box (in dots) of a group of changed pixels. |
Properties
| Property | Type | Description |
|---|---|---|
ChangedPixels { get; init; } | int | |
Height { get; init; } | int | |
Width { get; init; } | int | |
X { get; init; } | int | |
Y { get; init; } | int |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# Deconstruct(out int X, out int Y, out int Width, out int Height, out int ChangedPixels) | void |
ZplDiffResult
Result of ZplDiff.Compare.
public sealed class ZplDiffResultResult of ZplDiff.Compare.
Constructors
| Signature | Description |
|---|---|
# ZplDiffResult() |
Properties
| Property | Type | Description |
|---|---|---|
ChangedPixels { get; } | int | |
LabelCountA { get; init; } | int | |
LabelCountB { get; init; } | int | |
Labels { get; init; } | IReadOnlyList<ZplLabelDiff> | |
LinesAdded { get; } | int | |
LinesRemoved { get; } | int | |
PixelIdentical { get; } | bool | True 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 …
public static class ZplFormatterPretty-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.
^XA) is ignored by printers and dropped.Methods
| Method Signature | Returns | Description |
|---|---|---|
static # Format(string zpl, ZplOutputOptions? options = default) | string | Formats zpl; default: pretty-printed, 2 spaces indentation. |
static # Minify(string zpl, bool keepComments = false) | string | Removes 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…
public static class ZplGs1MigrationGS1 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
| Field | Type | Description |
|---|---|---|
const MaxModuleMm = 0.99 | double | X-dimension range for 2D symbols at retail POS (GS1 General Specifications 26.0 Table 5-46). |
const MinModuleMm = 0.396 | double | X-dimension range for 2D symbols at retail POS (GS1 General Specifications 26.0 Table 5-46). |
Methods
| Method Signature | Returns | Description |
|---|---|---|
static # Migrate(string zpl, Gs1MigrationOptions? options = default) | Gs1MigrationResult | Analyses zpl and adds the 2D carriers (see the class description). |
ZplLabelDiff
Pixel comparison of one label (A = before, B = after).
public sealed class ZplLabelDiffPixel comparison of one label (A = before, B = after).
Constructors
| Signature | Description |
|---|---|
# ZplLabelDiff() |
Properties
| Property | Type | Description |
|---|---|---|
AddedPixels { get; init; } | int | Ink only in B (drawn green in the overlay). |
ChangedPixels { get; } | int | |
Height { get; init; } | int | |
Identical { get; } | bool | |
Index { get; init; } | int | 0-based label index. |
MissingInA { get; init; } | bool | The label exists only in B (A has fewer labels). |
MissingInB { get; init; } | bool | The 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; } | int | Ink only in A (drawn red in the overlay). |
UnchangedPixels { get; init; } | int | Ink 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…
public static class ZplRescalerConverts 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:).
Methods
ZplCore.Twin #
24 typesPrinter Twin hardware compatibility checker, Zebra printer profiles with citations, and print-time estimation (ZplPrinterTwin, PrinterProfiles).
OptionAvailability
Whether a hardware option exists for a model.
PrintMethod
Print methods a model supports.
public enum PrintMethodPrint methods a model supports.
Values
| Name | Value | Description |
|---|---|---|
DirectThermal | 0 | |
ThermalTransfer | 1 |
PrinterDetection
Result of PrinterProfiles.Detect.
public record PrinterDetectionResult of PrinterProfiles.Detect.
Constructors
| Signature | Description |
|---|---|
# 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
| Property | Type | Description |
|---|---|---|
Candidates { get; init; } | IReadOnlyList<PrinterProfile> | All profiles that fit. |
Identity { get; init; } | PrinterIdentity | Parsed values. |
Match { get; init; } | ProfileMatch | Match quality. |
Notes { get; init; } | IReadOnlyList<string> | Why the match is not exact, conflicts … |
Profile { get; init; } | PrinterProfile | Best profile (with the reported firmware applied via PrinterProfile.WithFirmware), null if none. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# 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).
public record PrinterIdentityWhat a printer said about itself (parsed by PrinterProfiles.Detect).
Constructors
| Signature | Description |
|---|---|
# PrinterIdentity() |
Properties
| Property | Type | Description |
|---|---|---|
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; } | string | Firmware as reported, e.g. "V89.21.46Z". |
FirmwareVersion { get; } | ZplFirmwareVersion | |
Languages { get; init; } | string | device.languages or the ~HQPP / IEEE 1284 command set. |
MemoryKb { get; init; } | long? | ~HI memory field in KB. |
Model { get; init; } | string | Model 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.
public enum PrinterOptionHardware options that ZPL commands depend on.
Values [Flags]
| Name | Value | Description |
|---|---|---|
None | 0 | |
Cutter | 0x1 | Cutter (^MMC, ^MMD, ^MMK, ~JK, ^CN). |
Peeler | 0x2 | Peeler / dispenser (^MMP). |
Rewinder | 0x4 | Rewinder or liner take-up (^MMR). |
Rfid | 0x8 | UHF RFID encoder (^RF, ^RS, ^RB, ^WT, ^HR ...; ^MMF). |
Linerless | 0x10 | Linerless media (^MML, ^MMU). |
Applicator | 0x20 | Applicator interface (^MMA). |
RealTimeClock | 0x40 | Real-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…
public sealed class PrinterProfileDevice 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
| Signature | Description |
|---|---|
# PrinterProfile() |
Properties
| Property | Type | Description |
|---|---|---|
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; } | string | desktop, industrial, mobile or generic. |
Cutter { get; init; } | ProfileFact<OptionAvailability> | |
Description { get; init; } | string | Free text, e.g. "203 dpi direct thermal". |
DotsPerMm { get; } | double | Dots 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; } | string | Model family, e.g. "ZD421". |
Firmware { get; init; } | ProfileFact<string> | Latest firmware version found in the sources, e.g. "V93.21.39Z". |
FirmwareOverride { get; } | string | The firmware override set by PrinterProfile.WithFirmware, if any. |
FirmwareText { get; } | string | The firmware the checks assume, as written (override or PrinterProfile.Firmware), null when unknown. |
FirmwareVersion { get; } | ZplFirmwareVersion | Firmware 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; } | string | Unique id, e.g. "ZD421d-203". |
InstalledOptions { get; init; } | PrinterOption | Options 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; } | bool | True 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; } | string | Model 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; } | string | Vendor of the hardware described (descriptive only). |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# Availability(PrinterOption option) | ProfileFact<OptionAvailability> | Availability of one option. |
# CreateRenderSettings(ZplRenderSettings? baseSettings = default) | ZplRenderSettings | Render 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) | bool | The option is installed on the modelled printer. |
# ToString() | string | |
# WithFirmware(string firmware) | PrinterProfile | A copy that the checks treat as running firmware (e.g. "V60.13.0.10" for an old printer). |
# WithOptions(PrinterOption options) | PrinterProfile | A 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…
public static class PrinterProfilesThe 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
| Property | Type | Description |
|---|---|---|
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; } | PrinterProfile | The generic profile (zplCore defaults, no hardware limits that are not assumptions). |
static SchemaJson { get; } | string | JSON schema (draft 2020-12) of a profile family file. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
static # Detect(string response) | PrinterDetection | Parses 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) | PrinterProfile | Finds a profile by id or alias (case-insensitive; "ZD421-203", "zd421d-203" and "ZD421d 203" all match); null if none. |
static # Get(string idOrAlias) | PrinterProfile | Like 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) | void | Adds or replaces a custom profile (process-wide). |
static # ToJson(PrinterProfile profile, bool indented = true) | string | The profile as a flat JSON object (facts with status, value, sources, quote, note; sources with URLs). |
static # Unregister(string id) | bool | Removes 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 …
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
| Signature | Description |
|---|---|
# ProfileFact() |
Properties
| Property | Type | Description |
|---|---|---|
Exhaustive { get; init; } | bool | For 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; } | bool | The fact has a value (verified, derived or assumed). |
Note { get; init; } | string | Why the value is derived / unknown, conflicts between sources etc. |
Quote { get; init; } | string | Short 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; } | T | The value; default for ProfileFactStatus.Unknown. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# ToString() | string | |
static # Unknown(string? note = default) | ProfileFact<T> | An unknown fact. |
ProfileFactStatus
How a ProfileFact value is backed.
public enum ProfileFactStatusHow a ProfileFact value is backed.
Values
| Name | Value | Description |
|---|---|---|
Verified | 0 | The value is stated in a cited source (spec sheet, user guide, release notes). |
Derived | 1 | Computed or combined from verified facts (e.g. dots from mm and dpi); the note says how. |
Assumed | 2 | A modelling assumption, not a vendor statement (used by the generic profile and for custom data). |
Unknown | 3 | No source found. Checks that need the value report that they could not check it. |
ProfileMatch
How well PrinterDetection.Profile matches.
ProfileSource
A cited source of profile data.
public record ProfileSourceA cited source of profile data.
Constructors
| Signature | Description |
|---|---|
# 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
| Property | Type | Description |
|---|---|---|
Accessed { get; init; } | string | Date the document was read (yyyy-MM-dd). |
Id { get; init; } | string | Id used by ProfileFact.Sources. |
Note { get; init; } | string | E.g. "distributor copy of the official sheet". |
Title { get; init; } | string | Document title, part number or date. |
Url { get; init; } | string | Where the document was read. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# 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…
public record ZplFirmwareVersionZebra-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
| Signature | Description |
|---|---|
# 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
| Property | Type | Description |
|---|---|---|
Build { get; init; } | int? | |
FeatureLevel { get; init; } | int | |
Platform { get; init; } | int | |
Prefix { get; init; } | char | |
Suffix { get; init; } | string |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# Deconstruct(out char Prefix, out int Platform, out int FeatureLevel, out int? Build, out string Suffix) | void | |
static # TryParse(string text) | ZplFirmwareVersion | Parses "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.
public record ZplLabelEstimateEstimated time of one printed label.
Constructors
| Signature | Description |
|---|---|
# 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
| Property | Type | Description |
|---|---|---|
Cut { get; init; } | bool | The printer cuts after this label. |
Duration { get; init; } | TimeSpan | Print, backfeed and cut time of this label. |
Index { get; init; } | int | Label index in print order (^PQ copies included). |
LengthMm { get; init; } | double | Printed length (label plus gap). |
PauseAfter { get; init; } | bool | The printer pauses after this label (operator action, not included). |
Start { get; init; } | TimeSpan | Time from the start of the transfer until the label starts printing. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# 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…
public sealed class ZplPrintEstimatePrint 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
| Property | Type | Description |
|---|---|---|
Assumptions { get; } | IReadOnlyList<string> | Every assumption the numbers depend on. |
Bytes { get; } | long | Job size in bytes (UTF-8). |
BytesPerSecond { get; } | double | |
Cuts { get; } | int | |
FirstLabel { get; } | TimeSpan | Time 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). |
Link { get; } | ZplPrinterLink | |
Pauses { get; } | int | ^PQ pauses (operator presses resume; waiting time not included). |
Printing { get; } | TimeSpan | Sum of the label times (print, gap, backfeed, cut). |
Profile { get; } | PrinterProfile | |
SpeedIps { get; } | double | Effective print speed of the first label in inches per second (after the model limit). |
Total { get; } | TimeSpan | Estimated time from the start of the transfer until the last label is out. |
TotalLengthMm { get; } | double | Media fed through the printer in mm. |
Transfer { get; } | TimeSpan | Time to send the job over the link (it overlaps with printing). |
Methods
ZplPrintEstimateOptions
Assumptions of ZplPrinterTwin.Estimate; every default is listed in ZplPrintEstimate.Assumptions.
public sealed class ZplPrintEstimateOptionsAssumptions of ZplPrinterTwin.Estimate; every default is listed in ZplPrintEstimate.Assumptions.
Constructors
| Signature | Description |
|---|---|
# ZplPrintEstimateOptions() |
Properties
| Property | Type | Description |
|---|---|---|
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; } | double | Time a label takes to format before printing starts, in seconds (default 0: not included). |
GapMm { get; set; } | double | Gap or mark between labels in mm, fed at print speed (default 0: not included). |
Link { get; set; } | ZplPrinterLink | |
MaxRenderedLabels { get; set; } | int | Labels the job may produce before the estimate extrapolates per format instead of rendering every copy (default 200). |
Methods
| Method Signature | Returns | Description |
|---|---|---|
static # AssumedBytesPerSecond(ZplPrinterLink link) | double | Assumed 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). |
ZplPrinterLink
Host link for the transfer part of ZplPrinterTwin.Estimate.
ZplPrinterTwin
Printer twin: answers "will this label print correctly on this printer model?" with a PrinterProfile. ZplPrinterTwin.…
public static class ZplPrinterTwinPrinter 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 Signature | Returns | Description |
|---|---|---|
static # Check(string zpl, PrinterProfile profile, ZplTwinOptions? options = default) | ZplTwinReport | Checks zpl against profile. |
static # Estimate(string zpl, PrinterProfile profile, ZplPrintEstimateOptions? options = default) | ZplPrintEstimate | Estimates 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) | ZplTwinRender | Renders 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.
public record ZplTwinClipA field cut off by the printhead width.
Constructors
| Signature | Description |
|---|---|
# 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
| Property | Type | Description |
|---|---|---|
ClippedDots { get; init; } | int | Dots of the field's width beyond the printhead. |
Command { get; init; } | string | Field command, e.g. "BC", "A", "GB". |
Content { get; init; } | string | Field data (shortened). |
Fully { get; init; } | bool | The whole field is outside the printable width. |
Height { get; init; } | int | Height in dots. |
LabelIndex { get; init; } | int | 0-based label. |
Width { get; init; } | int | Width in dots. |
X { get; init; } | int | Left edge in dots. |
Y { get; init; } | int | Top edge in dots. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# 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).
public static class ZplTwinDiagnosticCodesStable codes of printer twin diagnostics (ZPL5xxx, see DIAGNOSTICS.md and docs-internal/printer-twin.md).
Fields & Constants
| Field | Type | Description |
|---|---|---|
const ClockMissing = "ZPL5205" | string | Real-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" | string | Heuristic: ^PW/^LL are whole label sizes at another resolution, not at this printer's. |
const DpiMismatch = "ZPL5104" | string | The label was designed for another resolution (ZplTwinOptions.DesignDpi): it prints scaled. |
const EncodingUnsupported = "ZPL5303" | string | Unicode or TrueType use on a model whose profile says it is not supported (or unknown). |
const FieldClipped = "ZPL5102" | string | A field lies partly or completely outside the printhead width and is clipped. |
const FirmwareTooOld = "ZPL5201" | string | The 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" | string | The font is not in the profile's resident font list (or the list is not exhaustive / unknown). |
const GlyphCoverage = "ZPL5304" | string | Text with characters outside the code page of a bitmap font, or whose glyph coverage in font 0 is not documented. |
const LanguageUnsupported = "ZPL5203" | string | The profile lists printer languages without ZPL. |
const LengthExceedsMaximum = "ZPL5103" | string | ^LL or the content is longer than the maximum print length. |
const MemoryBudget = "ZPL5402" | string | Memory budget summary per drive (downloads in the job). |
const MemoryOverflow = "ZPL5401" | string | Downloaded graphics, fonts and formats exceed the user memory of a drive. |
const OptionMissing = "ZPL5202" | string | The 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" | string | A 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.
public record ZplTwinDownloadDownloaded object stored on a printer drive.
Constructors
| Signature | Description |
|---|---|
# 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
| Property | Type | Description |
|---|---|---|
Bytes { get; init; } | long | Size in bytes (declared size parameter, or the data length). |
Command { get; init; } | string | ~DG, ~DY, ~DU, ~DT, ~DB, ~DE, ^DF, ^IS. |
Drive { get; init; } | string | R:, E:, B:, A: … |
Name { get; init; } | string | Object name with extension. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# 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.
public record ZplTwinMemoryUseUse of one drive by the downloads of the job.
Constructors
| Signature | Description |
|---|---|
# 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
| Property | Type | Description |
|---|---|---|
CapacityBytes { get; init; } | long? | User-available memory from the profile; null when unknown. |
Drive { get; init; } | string | R:, E:, B:, A:. |
Ratio { get; } | double? | Used share of the capacity (0–1+), null when the capacity is unknown. |
UsedBytes { get; init; } | long | Sum of the downloads (an object downloaded twice counts once). |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# Deconstruct(out string Drive, out long UsedBytes, out long? CapacityBytes) | void |
ZplTwinOptions
Options of ZplPrinterTwin.Check.
public sealed class ZplTwinOptionsOptions of ZplPrinterTwin.Check.
Constructors
| Signature | Description |
|---|---|
# ZplTwinOptions() |
Properties
| Property | Type | Description |
|---|---|---|
DefaultLabelLengthMm { get; set; } | double | Default 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; } | bool | Also 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.
public sealed class ZplTwinRender : IDisposableResult of ZplPrinterTwin.Render: the labels as the printer prints them and the twin report.
Constructors
| Signature | Description |
|---|---|
# ZplTwinRender(List<ZplRenderResult> results, ZplTwinReport report) | Result of ZplPrinterTwin.Render: the labels as the printer prints them and the twin report. |
Properties
| Property | Type | Description |
|---|---|---|
Report { get; } | ZplTwinReport | Findings of ZplPrinterTwin.Check, including font substitutions. |
Results { get; } | List<ZplRenderResult> | Rendered labels, cropped at the printhead width. |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# Dispose() | void |
ZplTwinReport
Result of ZplPrinterTwin.Check.
public sealed class ZplTwinReportResult of ZplPrinterTwin.Check.
Properties
| Property | Type | Description |
|---|---|---|
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; } | bool | No warnings or errors (info findings allowed). |
LabelCount { get; } | int | Number of rendered labels (one per format, ^PQ copies not counted). |
LabelLengthDots { get; } | int | Length of the first label in dots (^LL or the default media length). |
LabelWidthDots { get; } | int | Width 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; } | PrinterProfile | The profile checked against (with options and firmware override). |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# Fails(ZplDiagnosticSeverity severity) | bool | True when a finding has at least severity. |
# ToJson(bool indented = true) | string | The report as JSON: profile id, diagnostics, clips, downloads, memory. |
# ToString() | string | |
# ToText(string? fileName = default) | string | Human-readable report. |
ZplCore.VectorLift #
8 typesPDF and SVG to native ZPL conversion engine (VectorLift, VectorLiftOptions, VectorLiftResult, LiftedElement).
LiftFontMode
How text is reproduced in ZPL.
public enum LiftFontModeHow text is reproduced in ZPL.
Values
| Name | Value | Description |
|---|---|---|
Font0 | 0 | Scalable printer font 0 (^A0) with height and width fitted to the original run (default, no download). |
EmbedTrueType | 1 | Download 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.
public enum LiftOutcomeWhat happened to a source element.
Values
| Name | Value | Description |
|---|---|---|
Native | 0 | Reproduced exactly with a native command (^GB, ^GC, ^B…). |
Approximated | 1 | Native command with approximation (e.g. text in font 0 instead of the original font). |
Raster | 2 | Reproduced as ^GF graphic of its region. |
Dropped | 3 | Not 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.
LiftedElement
Report entry for one element of the original.
public record LiftedElementReport entry for one element of the original.
Constructors
| Signature | Description |
|---|---|
# LiftedElement() |
Properties
| Property | Type | Description |
|---|---|---|
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; } | string | Barcode 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; } | string | Why the element is approximated, rasterized or dropped. |
Score { get; init; } | double? | Pixel agreement of the element alone (0–1), when measured. |
Text { get; init; } | string | Text content or decoded barcode data. |
Zpl { get; init; } | string | The generated command(s) for native elements. |
LiftedKind
Kind of a source element.
VectorLift
Vector-Lift: converts PDF and SVG labels into native ZPL – text as ^A0 fields, barcodes as native ^B commands (decoded, regener…
public static class VectorLiftVector-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 Signature | Returns | Description |
|---|---|---|
static # Convert(byte[] data, VectorLiftOptions? options = default) | VectorLiftResult | Converts a PDF (page VectorLiftOptions.Page) or, when the data is SVG text, an SVG. |
static # ConvertPdf(byte[] pdf, VectorLiftOptions? options = default) | VectorLiftResult | Converts 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) | VectorLiftResult | Converts an SVG document. |
static # PdfPageCount(byte[] pdf) | int | Number of pages of a PDF. |
VectorLiftOptions
Options for VectorLift.
public sealed class VectorLiftOptionsOptions for VectorLift.
Constructors
| Signature | Description |
|---|---|
# VectorLiftOptions() |
Properties
| Property | Type | Description |
|---|---|---|
CompareTolerance { get; set; } | int | Pixel tolerance of the fidelity comparison (see ImageCompare). |
CropMarginMm { get; set; } | double | Margin around the content when VectorLiftOptions.CropToContent is set. |
CropToContent { get; set; } | bool | Crop 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; } | LiftFontMode | Text 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; } | GraphicCompression | Compression 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; } | DitherMode | Dithering for photo-like images that fall back to ^GF (line art is always thresholded). |
IncludeImages { get; set; } | bool | Include PNGs of the original, the lifted render and the diff in the result. |
LiftBarcodes { get; set; } | bool | Detect, decode and regenerate barcodes as native ^B commands (otherwise as graphic). |
LiftShapes { get; set; } | bool | Reproduce lines, boxes, circles and ellipses as ^GB/^GC/^GE/^GD (otherwise as graphic). |
LiftText { get; set; } | bool | Reproduce text as ZPL text fields (otherwise as graphic). |
MeasureFidelity { get; set; } | bool | Render the result and compare it with the original (fills the fidelity values). |
MinShapeScore { get; set; } | double | Minimum per-element score (0–1) for a native shape; below it the shape becomes graphic. |
Page { get; set; } | int | PDF page (1-based). |
Scale { get; set; } | LiftScale | Scaling 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.
public sealed class VectorLiftResultResult of a Vector-Lift conversion of one page.
Constructors
| Signature | Description |
|---|---|
# VectorLiftResult() |
Properties
| Property | Type | Description |
|---|---|---|
BarcodesMatch { get; } | bool | All 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; } | string | How 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; } | double | Share 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; } | int | Page (1-based) for PDF input. |
required RasterZplBytes { get; init; } | int | Size 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; } | string | Print-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; } | string | The label as ZPL (^XA…^XZ). |
ZplBytes { get; } | int | Size of VectorLiftResult.Zpl in bytes (UTF-8). |
Methods
| Method Signature | Returns | Description |
|---|---|---|
# Count(LiftOutcome outcome) | int | Count of elements per outcome. |
# ToJson(bool indented = true) | string | Machine-readable report (no images). |
# ToLabel(ImportOptions? options = default) | LabelImportResult | The ZPL as editable label model (via Label.FromZpl). |
# ToReport() | string | Human-readable report (one line per element). |
No API types or members match your current filter.

