OpenLabel 0.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package OpenLabel --version 0.1.0
                    
NuGet\Install-Package OpenLabel -Version 0.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="OpenLabel" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="OpenLabel" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="OpenLabel" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add OpenLabel --version 0.1.0
                    
#r "nuget: OpenLabel, 0.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package OpenLabel@0.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=OpenLabel&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=OpenLabel&version=0.1.0
                    
Install as a Cake Tool

<div align="center">

OpenLabel

ZPL Labeling with Open-Source Flexibility

<img alt="OpenLabel logo" height="280" src="/assets/openlabel.png" />

</div>

Project Description

OpenLabel 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.</br></br> 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.</br></br> 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.

Table of Contents

Features

  • Print ZPL Labels: Easily send ZPL commands to a Zebra printer over the network.
  • Scale Labels: Adjust ZPL code to fit different printer resolutions (DPI).
  • Template System: Replace placeholders with actual values and handle conditional statements inside ZPL templates.

Installation

Add this library to your project via NuGet or by including the source code.

Usage

1. Print a Label

NetworkPrinter printer = new NetworkPrinter();
await printer.PrintLabelAsync(@"\\server\printer", 5, "^XA^FO50,50^A0N,50,50^FDHello, World!^FS^XZ");

2. Scale a Label

string scaledZPL = LabelScaler.ScaleZPL("^XA^FO50,50^FS^XZ", 203, 300);

3. Use Templates

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);

License

This software is licensed under the GPL-3.0 license

Acknowledgements

  • The code for the ZPL scaling was in large part possible with the work of:
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.2 124 8/1/2025
1.0.1 237 2/26/2025
1.0.0 136 2/26/2025
0.1.1 122 2/25/2025
0.1.0 129 2/25/2025