public static class PrinterProfiles
The printer profile catalogue: built-in profiles (embedded JSON, one file per family, schema PrinterProfiles.SchemaJson), custom profiles added with PrinterProfiles.Register / PrinterProfiles.Load, lookup by id or alias and detection from printer responses (PrinterProfiles.Detect).
Properties
| 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. |