A library for working with ZPL templates, scaling, and printing labels
License
—
Deps
0
Install Size
—
Vulns
✓ 0
Published
Aug 1, 2025
$ dotnet add package OpenLabelOpenLabel is a C# library designed to streamline working with Zebra Programming Language (ZPL) for label printing. It enables developers to send ZPL commands to Zebra label printers, scale labels for different printer resolutions, and customize labels using a flexible templating system. This library is particularly useful for scenarios where ZPL labels are generated using external tools like Labelary or other ZPL design software. With OpenLabel, developers can dynamically modify these labels by replacing placeholders, handling conditional statements, and ensuring compatibility across different printer resolutions. Whether you need to automate label printing, generate dynamic ZPL templates, or adjust labels for varying printer resolutions, OpenLabel provides the flexibility and simplicity required for efficient label management.
Add this library to your project via NuGet or by including the source code.
NetworkPrinter printer = new NetworkPrinter();
await printer.PrintLabelAsync(@"\\server\printer", 5, "^XA^FO50,50^A0N,50,50^FDHello, World!^FS^XZ");
string scaledZPL = LabelScaler.ScaleZPL("^XA^FO50,50^FS^XZ", 203, 300);
TemplateHandler templateHandler = new TemplateHandler();
string template = "{{IF CONDITION}}^FO50,50^FDText^FS{{ENDIF}}";
Dictionary<string, string> placeholders = new Dictionary<string, string> { { "CONDITION", "1" } };
string renderedLabel = templateHandler.RenderTemplate(template, placeholders);
This software is licensed under the GPL-3.0 license