ZplFormatter
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.
Input whose output would not parse back to the same commands (only possible with exotic ^CC/^CT/^CD combinations) is returned unchanged. Text outside of commands (e.g. stray characters before
^XA) is ignored by printers and dropped.Try it online on zplCloud.com: ZPL Formatter
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). |

