ZPL2PDF is a command-line tool designed to convert Zebra Programming Language (ZPL) labels into PDF files offline. This utility reads ZPL/ZPL II code, renders it in memory, and generates a multi-page PDF where each page represents a label. Built on BinaryKits.Zpl, ZPL2PDF is optimized for automated workflows, bulk processing, and integration with enterprise systems.
Key Features:
Accurate ZPL Rendering: Converts ZPL labels to high-quality images without temporary files.
Batch Conversion: Generates multi-page PDFs from multiple labels in a single file.
Windows CLI: Supports command-line operations for scripting and automation.
Customizable Output: Adjust label dimensions, density, and units (inches, centimeters, millimeters) to match specific requirements.
Audience & Benefit:
Ideal for developers, IT professionals, and warehouse teams requiring offline ZPL-to-PDF conversion. This tool streamlines label processing for automated print pipelines, ERP systems, and bulk operations, saving time and reducing manual steps in workflows.
Install via winget or download the executable from the official repository to integrate ZPL2PDF into your workflow efficiently.
A powerful, cross-platform command-line tool that converts ZPL (Zebra Programming Language) files to high-quality PDF documents. Perfect for label printing workflows, automated document generation, and enterprise label management systems.
🚀 What's New in v3.0.2
🐛 Bug Fixes
Fixed Issue #45: Duplicate or blank labels when ^XA appears inside ~DGR: base64 payload — ^XA is now treated as label start only at line start or after ^XZ.
Issue #48 – TCP Server: Virtual Zebra printer mode is now implemented. Use ZPL2PDF server start --port 9101 -o output/, server stop, and server status.
REST API (PR #47): Run ZPL2PDF --api --host localhost --port 5000 for POST /api/convert (ZPL to PDF or PNG) and GET /api/health.
🚀 What's New in v3.0.1
🐛 Bug Fixes
Fixed Issue #39: Sequential graphic processing for multiple graphics with same name
ZPL files with multiple ~DGR graphics now process correctly
Each label uses the correct graphic based on sequential state
^IDR cleanup commands no longer generate blank pages
Resolves issue where all labels were identical in Shopee shipping label files
🔧 Improvements
Added input validation in public methods
Improved exception handling
Performance optimizations with compiled regex
Code cleanup and removal of unused methods
🚀 What's New in v3.0.0
🎉 Major New Features
🎨 Labelary API Integration - High-fidelity ZPL rendering with vector PDF output
🖨️ TCP Server Mode - Virtual Zebra printer on TCP port (default: 9101)
🔤 Custom Fonts - Load TrueType/OpenType fonts with --fonts-dir and --font
📁 Extended File Support - Added .zpl and .imp file extensions
📝 Custom Naming - Set output filename via ^FX FileName: in ZPL
🔧 Rendering Options
--renderer offline # BinaryKits (default, works offline)
--renderer labelary # Labelary API (high-fidelity, requires internet)
--renderer auto # Try Labelary, fallback to BinaryKits
🖨️ TCP Server (Virtual Printer)
ZPL2PDF server start --port 9101 -o output/
ZPL2PDF server status
ZPL2PDF server stop
v2.x Features (Still Available)
🌍 Multi-language Support - 8 languages (EN, PT, ES, FR, DE, IT, JA, ZH)
🔄 Daemon Mode - Automatic folder monitoring and batch conversion
🏗️ Clean Architecture - Completely refactored with SOLID principles
🌍 Cross-Platform - Native support for Windows, Linux, and macOS
# Start with default settings
ZPL2PDF start
# Start with custom folder
ZPL2PDF start -l "C:\Labels" -w 7.5 -h 15 -u in
# Check status
ZPL2PDF status
# Stop daemon
ZPL2PDF stop
📖 Usage Guide
Conversion Mode Parameters
ZPL2PDF -i -o [options]
ZPL2PDF -z -o [options]
Parameter
Description
Example
-i
Input ZPL file (.txt, .prn, .zpl, .imp)
-i label.zpl
-z
ZPL content as string
-z "^XA...^XZ"
-o
Output folder for PDF
-o C:\Output
-n
Output PDF filename (optional)
-n result.pdf
-w
Label width
-w 10
-h
Label height
-h 5
-u
Unit (mm, cm, in)
-u cm
-d
Print density (default: 203)
-d 300
--renderer
Rendering engine (offline/labelary/auto)
--renderer labelary
--fonts-dir
Custom fonts directory
--fonts-dir C:\Fonts
--font
Map specific font
--font "A=arial.ttf"
Daemon Mode Commands
ZPL2PDF start [options] # Start daemon in background
ZPL2PDF stop # Stop daemon
ZPL2PDF status # Check daemon status
ZPL2PDF run [options] # Run daemon in foreground (testing)
Option
Description
Default
-l
Folder to monitor
Documents/ZPL2PDF Auto Converter
-w
Fixed width for all conversions
Extract from ZPL
-h
Fixed height for all conversions
Extract from ZPL
-u
Unit of measurement
mm
-d
Print density
203
TCP Server Commands
ZPL2PDF server start [options] # Start TCP server (virtual printer)
ZPL2PDF server stop # Stop TCP server
ZPL2PDF server status # Check TCP server status
Option
Description
Default
--port
TCP port to listen on
9101
-o
Output folder for PDFs
Documents/ZPL2PDF TCP Output
--foreground
Run in foreground (not background)
Background
--renderer
Rendering engine
offline
Language Commands
--language # Temporary language override
--set-language # Set language permanently
--reset-language # Reset to system default
--show-language # Show current configuration
src/
├── Application/ # Use Cases & Services
│ ├── Services/ # Business logic
│ └── Interfaces/ # Service contracts
├── Domain/ # Business entities & rules
│ ├── ValueObjects/ # Immutable data objects
│ └── Services/ # Domain interfaces
├── Infrastructure/ # External concerns
│ ├── FileSystem/ # File operations
│ ├── Rendering/ # PDF generation
│ └── Processing/ # Queue management
├── Presentation/ # CLI & user interface
│ └── Handlers/ # Mode handlers
└── Shared/ # Common utilities
├── Localization/ # Multi-language
└── Constants/ # Configuration
🧪 Testing
Run Tests
# All tests
dotnet test
# Unit tests only
dotnet test tests/ZPL2PDF.Unit/
# Integration tests
dotnet test tests/ZPL2PDF.Integration/
# With coverage
dotnet test --collect:"XPlat Code Coverage"