zplCore.comzplCore.com

LabelSource

public static class LabelSource

Reads label files for ZplCheck: ZPL (.zpl, .prn, .txt …) and label JSON (Label.FromJson).

Properties

PropertyTypeDescription
static DefaultPatterns { get; }IReadOnlyList<string>Default patterns of zplcore check without arguments.

Methods

Method SignatureReturnsDescription
static # Expand(IEnumerable<string> patterns, string root)IReadOnlyList<string>Expands files and glob patterns (**/*.zpl, labels/*.json, !**/draft/** to exclude) relative to root. Existing file paths are taken as they are. Result: absolute paths, sorted, distinct.
static # IsLabelJson(string json)boolTrue when json is a label JSON object (items, width, height).
static # Load(string path, int dpi)stringLoads a label file as ZPL. JSON files must be label JSON (an object with items, width and height); other JSON returns null (not a label, skipped). Throws JsonException: The file looks like label JSON but cannot be loaded.
static # ReadZpl(byte[] bytes)stringDecodes ZPL bytes like the CLI: UTF-8 (with or without BOM) or UTF-16 with BOM; bytes that are not valid UTF-8 are read like a printer (ZplTextEncoding: code page 850 or the one of the active ^CI).