zplCore.comzplCore.com

24Label understanding & GDPR redaction

ZplExtract turns ZPL into structured data: every text with its role, every barcode with the data a scanner reads (GS1 elements with titles and checks, Digital Link, MaxiCode and ISO/IEC 15434 messages), and recognised entities – recipient, sender and return addresses, names, phone, e-mail, tracking numbers with check digits (UPS 1Z, UPU S10, DHL, PostNL, USPS …), SSCC, GTIN, batch, dates, weights – with confidence, sources and evidence. ZplRedact writes the same ZPL with personal data redacted: the layout stays, barcodes stay readable (valid placeholder data), and hidden places such as ^FX comments, ^DF/^XF data, ^FN defaults, ^SN, ^RF and 2D carrier messages are covered too – for example before labels go to support, service providers or tickets.

// using ZplCore.Extraction;

var result = ZplExtract.Run(zpl);                       // ExtractOptions: Dpi, FieldValues, MinimumConfidence
var label = result.Labels[0];
Console.WriteLine(label.Recipient?.Value);               // Jürgen Größmann / Bäckerei Süßwaren GmbH · Tor 3 / …
foreach (var e in label.Entities)                        // TrackingNumber, Sscc (check digit ok), Date, Weight …
    Console.WriteLine($"{e.Type} {e.Value} {e.Confidence:0.00} {e.CheckDigitValid}");
File.WriteAllText("label.json", result.ToJson());

var r = ZplRedact.Run(zpl, new RedactOptions { Categories = RedactCategories.Default, Mode = RedactMode.Mask });
File.WriteAllText("label-redacted.zpl", r.Zpl);          // same layout, barcodes stay valid
Console.WriteLine(r.Report.ToText());                    // actions + verification, never the removed values
zplcore extract label.zpl --format json -o label.json [--min-confidence 0.3]
zplcore redact label.zpl -o label-redacted.zpl --report [--categories default|personal|all|names,addresses,…]
               [--mode mask|replace|remove] [--terms "Project X,4711"]      # exit code 1 if values remain

Original

Shipping label with sender, recipient, tracking number and 2D codes

After ZplRedact.Run (default: mask)

The same label: names, addresses, tracking number and barcode contents replaced by placeholders, layout unchanged
Assistive and rule-based: captions in eight languages, layout, postal code patterns for 15 countries and public check digit algorithms – deterministic, no machine learning, no network. Extraction can miss things; redaction gives no guarantee of completeness. The default is conservative (unclassified text is redacted too), the output is verified by a second search, and the report never contains the removed values. Text inside images is not read. Review redacted output before sharing it – the tool supports data minimisation under the GDPR but does not replace a review.