EgoPDF.Zpl 1.0.0-preview.1

This is a prerelease version of EgoPDF.Zpl.
dotnet add package EgoPDF.Zpl --version 1.0.0-preview.1
                    
NuGet\Install-Package EgoPDF.Zpl -Version 1.0.0-preview.1
                    
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="EgoPDF.Zpl" Version="1.0.0-preview.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EgoPDF.Zpl" Version="1.0.0-preview.1" />
                    
Directory.Packages.props
<PackageReference Include="EgoPDF.Zpl" />
                    
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 EgoPDF.Zpl --version 1.0.0-preview.1
                    
#r "nuget: EgoPDF.Zpl, 1.0.0-preview.1"
                    
#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 EgoPDF.Zpl@1.0.0-preview.1
                    
#: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=EgoPDF.Zpl&version=1.0.0-preview.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=EgoPDF.Zpl&version=1.0.0-preview.1&prerelease
                    
Install as a Cake Tool

EgoPDF.Zpl

Render Zebra Programming Language (ZPL II) labels to PDF using EgoPDF.Generator and ZXing.Net.

Preview. The API is in flux. Bug reports and PRs welcome; expect breaking changes between preview versions.

Quick start

using Ego.PDF;
using Ego.PDF.Data;
using Ego.Pdf.Zpl;

using var pdf = new FPdf("label.pdf");
pdf.SetUnitConverionFactor(UnitEnum.Point, 203);

// Optional: load a TTF for the monospace ZPL fonts (^A?, ^CFA).
// Without this, ^A? falls back to whatever font is currently set.
pdf.LoadFont("robotomonob", "path/to/RobotoMono-Bold.ttf");
pdf.AddFont("robotomonob", "");
pdf.SetFont("helvetica", "B", 16);

var zpl = new PdfZpl(pdf, dpi: 203);
zpl.SetLabelSize(812, 1218);           // 4" x 6" at 203 dpi
zpl.SetVariableFont("helvetica", "B"); // mapped to ZPL font "0"
zpl.SetMonospaceFont("robotomonob");   // mapped to ZPL fonts "A".."V"

zpl.Print(@"
^XA
^FO50,50^FDHello from EgoPDF.Zpl!^FS
^FO50,200^BCN,80,N,N,N^FD12345678^FS
^XZ
");

pdf.Close();

Supported ZPL commands

Layout

^XA / ^XZ, ^FO, ^FT, ^FD, ^FS, ^FX, ^FH, ^FW, ^FR, ^FB, ^FN, ^CF, ^CI, ^LH, ^LL, ^PW, ^DF + ^XF (template + field substitution), ^A? (A-V, plus the proportional ^A0).

Graphics

^GB, ^GC, ^GE, ^GD, ^GF (inline ASCII bitmap with the ZPL RLE compression), ^XG (recall a host-registered graphic via PdfZpl.RegisterGraphic(name, filePath)).

Barcodes

ZPL command Symbology
^BC Code 128
^B3 Code 39
^B2 Interleaved 2 of 5
^BK Codabar
^BE EAN-13
^B8 EAN-8
^BU UPC-A
^B9 UPC-E
^BM MSI
^B7 PDF417
^BQ QR Code
^BX Data Matrix
^BO Aztec

All 1D symbologies honour orientation N (no rotation) and B (rotated 90° CCW). 2D symbologies honour N, B, R, I.

What it doesn't do

  • Print to a Zebra device. Output is PDF, not ZPL → ZPL.
  • Implement the full ZPL command surface. Printer-state commands (^MD, ^PR, ^JM, ^IL, ^IS, ^DG, ^DY, ^DU, ^LR, ^LS, ^PM, ^PO, ^PF) are silently accepted as no-ops.
  • Reproduce Zebra's bitmap fonts byte-for-byte — the package uses whatever TTF the host registers, so visible metrics differ slightly from what a real printer would emit. Pre-pick a label width to match the physical roll if you care about absolute sizing.

Targets

  • net8.0
  • net9.0

License

MIT. "ZPL" and "Zebra" are trademarks of Zebra Technologies; this package is not affiliated with or endorsed by them.

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 is compatible.  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.

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.0-preview.1 36 5/22/2026

1.0.0-preview.1: first public preview. Renders the common ZPL II label features to PDF via EgoPDF.Generator 2.1.0+. Not affiliated with Zebra Technologies; "Zebra" and "ZPL" are trademarks of Zebra Technologies.