zplCore.comzplCore.com

17Compliance pre-check: rule packs as code

Checks labels against public requirements before they print: ZplCompliance.Check renders the ZPL and measures the printed geometry – X-dimension in mm, bar height, quiet zones, human-readable text, text height, overlaps, cut-off symbols, GS1 AIs with check digits and combination rules, Digital Link syntax, MaxiCode carrier message. 72 rules in packs, each with a stable id, severity and citation.

Try it online on zplCloud.com: Label Compliance Check

More on zplCloud.com: Guide: Why Amazon rejects labels · Template: SSCC pallet label (GS1-128) · Template: UDI/HIBC device label

A pre-check, not a certification. A clean result means no rule found a problem. It does not replace acceptance by a carrier, retailer or regulator, nor a barcode verifier for the print quality of the finished label. State of the sources: October 2026.
Pack (--pack)ContentSources
gs1-logisticSSCC in GS1-128, X-dimension ≥ 0.495 mm, bar height, quiet zones, human-readable text ≥ 3 mm, AI formats and combinationsGS1 General Specifications 26.0, Logistic Label Guideline 1.3
sunriseSunrise 2027: GTIN in a GS1 DataMatrix or a QR Code with GS1 Digital Link next to the EAN/UPC, module size, URI syntaxGenSpecs 26.0, Digital Link URI Syntax 1.7.0
amazon-fba, ups, fedex, dhl-paketsizes, required barcodes, quiet zones, MaxiCode carrier message, 1Z check digitpublic carrier documentation (partly marked "advisory")
udiUDI-DI (01), production identifiers, date rules, permitted carriers21 CFR 801, EU MDR Annex VI, GenSpecs 26.0
rfiddoes ^RF write the EPC of the printed SSCC/GTIN? (see RFID Studio)GS1 EPC TDS 2.3
// using ZplCore.Compliance;

var report = ZplCompliance.Check(zpl, CompliancePacks.Gs1LogisticLabel | CompliancePacks.Sunrise2027,
    new ComplianceOptions { Dpi = 203 });          // ZPL carries no resolution: set the printer's dpi
foreach (var f in report.Findings)
    Console.WriteLine(f);  // label 1: ZPL3104 error (16:1): ^BC: X-dimension 0.25 mm … below the minimum 0.495 mm
File.WriteAllText("labels.sarif", report.ToSarif("labels/pallet.zpl"));   // GitHub Code Scanning
string json = report.ToJson();
List<byte[]> pngs = ZplCompliance.RenderAnnotated(zpl, report);          // frames + rule ids on the label
zplcore comply pallet.zpl --pack gs1-logistic,sunrise --dpi 203 [--format text|json|sarif] [--annotate out.png]
zplcore comply --list-rules --pack all          # every rule with id, severity and source

pallet.zpl:16:1: error ZPL3104: label 1 ^BC: X-dimension 0.25 mm (2 dot(s) at 203 dpi) is below the minimum
  0.495 mm for logistic units … [GS1 General Specifications 26.0 §5.12.3.5 Table 5-51]
    fix: Use ^BY4 or wider at 203 dpi.
1 label(s) at 203 dpi, packs gs1-logistic GenSpecs 26.0 / LLG 1.3: 4 error(s), 0 warning(s), 0 info(s).
Pre-check only, not a certification.

Annotated label

Pallet label with findings ZPL3104 and ZPL3110 marked in red on both GS1-128 barcodes

The pallet label of samples/compliance/gs1-logistic-sscc.zpl, but with ^BY2: both GS1-128 are too narrow and their text is too small.

Outputs & custom rules

  • Findings with rule id, pack, severity, command, line/column, bounding box in dots, source and suggested fix
  • JSON, text and SARIF 2.1.0 for GitHub code scanning (rules with helpUri)
  • RenderAnnotated: frames and rule ids drawn on the label
  • Custom rules with ComplianceRule.Create(…), custom packs with ComplianceRulePack; adapt built-in packs with .With(rule) / .Without("ZPL3117")
  • ComplianceOptions: Dpi, label size without ^PW/^LL, FieldValues, DisabledRules, SeverityOverrides, MinimumSeverity

Limits: ZPL carries no resolution – every millimetre rule applies to the given Dpi. Not covered: print quality grades (contrast, defects), label placement on the unit, HIBCC/ICCBBA UDIs, DHL Express and the FedEx label certification. Values from non-public sources are marked "advisory".