Skip to content
kzxlPublic

About

High-performance, zero-config network print bridge and RFC 8011 IPP server that turns USB host-based/GDI/CAPT printers into smart LAN printers for Windows, macOS, Linux, iOS & Android.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

Repository files navigation

ZPrint — Universal Zero-Configuration Network Print Bridge & RFC 8011 IPP Server

License: MIT .NET Multi-Target Zero External Dependencies Platform Tests Passing

  ███████╗██████╗ ██████╗ ██╗███╗   ██╗████████╗
  ╚══███╔╝██╔══██╗██╔══██╗██║████╗  ██║╚══██╔══╝
    ███╔╝ ██████╔╝██████╔╝██║██╔██╗ ██║   ██║   
   ███╔╝  ██╔═══╝ ██╔══██╗██║██║╚██╗██║   ██║   
  ███████╗██║     ██║  ██║██║██║ ╚████║   ██║   
  ╚══════╝╚═╝     ╚═╝  ╚═╝╚═╝╚═╝  ╚═══╝   ╚═╝   
  Universal LAN Zero-Configuration Print Bridge

ZPrint transforms any USB host-based, GDI, or CAPT printer (such as the legendary Canon LBP 2900 / 3000, HP LaserJet 1020 / P1005, Epson, and other legacy office printers) into a high-performance, driverless Network Smart IP Printer across your entire local area network (LAN/WLAN).

With native RFC 8011 IPP (Internet Printing Protocol) support, mobile devices (iPhone, iPad, Android) and desktop operating systems (macOS, Linux, Windows) can print seamlessly using their standard OS print dialog (Ctrl+P or Share -> Print) with zero manufacturer driver installation required on client devices.


Table of Contents

  1. Why ZPrint Was Created (The Motivation)
  2. Technical Deep-Dive: Why USB Printer Sharing Is Fundamentally Broken
  3. The Solution: A True Network IP Printer Architecture
  4. Architecture Overview
  5. Feature Comparison
  6. Quick Start
  7. Client Setup Walkthrough
  8. Host Server Administration
  9. CLI Reference
  10. Zero-Dependency Architecture
  11. Building & Testing
  12. License

Why ZPrint Was Created (The Motivation)

The Immortal Hardware Paradox

In offices, factories, hospitals, logistics warehouses, and schools worldwide, millions of ultra-durable USB laser printers refuse to die. The most iconic example is the Canon LBP 2900 / 3000 (and its HP twin, the LaserJet 1020). Built with heavy-duty metal rollers, mechanical simplicity, and indestructible toner cartridges (Canon 303 / HP 12A), these printers routinely outlive multiple computer cycles, operating system generations, and entire IT infrastructures.

The Modern Workplace Friction

While the printers endure, the surrounding computing environment has fundamentally transformed:

  • Teams no longer work on homogenous Windows desktop fleets. Workplaces are now filled with macOS MacBooks (Apple Silicon M1/M2/M3), iPads, iPhones (iOS), Android tablets, and Linux workstations.
  • To enable team members to print, the standard practice has always been to plug the USB printer into one Windows desktop and turn on Windows Printer Sharing (\\host\printer).
  • The result is an endless nightmare of IT support tickets:
    • Windows cumulative updates trigger error codes 0x0000011b or 0x00000709.
    • Non-Windows devices cannot connect at all.
    • Client machines struggle to find or install matching 32-bit / 64-bit drivers over the network.
    • Spoolers hang whenever two people print at once, requiring a manual reboot of the host PC or restarting the spooler service.
  • Systems administrators resort to risky registry hacks (RpcAuthnLevelPrivacyEnabled = 0) that compromise network security, only to have the next Windows update overwrite their changes. Replacing these bulletproof printers with commercial network printers costs hundreds or thousands of dollars and introduces costly, fragile cartridge DRM.

ZPrint was created to solve this chronic engineering dilemma permanently. It bridges the legacy USB world and modern network standards, converting a USB printer into a True Network IP Printer that is immune to Windows RPC hardening, completely driverless for client devices, and natively accessible from any operating system on the LAN.


Technical Deep-Dive: Why USB Printer Sharing Is Fundamentally Broken

To understand why ZPrint's architecture is necessary, one must examine the low-level technical failure modes of traditional sharing methods.

2.1 The Host-Based / CAPT Architecture Trap: Dumb Hardware vs Smart Host

There are two fundamentally different classes of printers:

Characteristic Enterprise Network Printer (PostScript / PCL) Host-Based / CAPT / GDI Printer (USB)
Onboard Processor Dedicated 500MHz–1.2GHz RISC / ARM CPU None (Pure mechanical microcontroller)
Onboard Memory 512 MB – 2 GB RAM Minimal internal line buffer (~64 KB - 2 MB)
Rasterizer (RIP) Onboard hardware Raster Image Processor Host PC CPU (Software rasterizer)
Input Protocol High-level vector descriptions (PCL 5/6, PostScript, PDF) Raw proprietary binary dot-matrix bitmaps
USB Handshake Unidirectional or standard IEEE-1284 / USB print Tight, proprietary bidirectional engine sync

Printers like the Canon LBP 2900 utilize CAPT (Canon Advanced Printing Technology). The printer hardware is essentially a "dumb" laser scanning assembly and paper transport. It has no capability to render fonts, compute vector Bézier curves, or parse PostScript.

The host PC's CPU must rasterize every character and vector path into an enormous raw bitmap (up to 30–50 MB per page at 600 DPI) and stream it using proprietary microcode. Furthermore, the CAPT driver continuously interrogates the printer engine over USB (monitoring laser polygon mirror synchronization, toner sensor capacitance, fuser roller temperature, and paper registration interrupts).

Why this breaks over SMB network sharing: When shared via standard Windows SMB, the client PC's driver attempts to execute this proprietary rasterization and communicate over SMB remote procedure call (RPC) pipes. High latency, packet jitter, or minor OS version discrepancies cause the CAPT engine to lose synchronization, resulting in dropped jobs, communication timeouts, or driver crashes.


2.2 The Windows SMB & RPC Security Nightmare (0x0000011b & 0x00000709)

Windows printer sharing relies on MS-RPRN (Print System Remote Protocol) transported over SMB named pipes (\pipe\spoolss).

Following the discovery of the catastrophic PrintNightmare vulnerabilities (CVE-2021-34527 and CVE-2021-1675), Microsoft permanently hardened the Windows Print Spooler:

  1. RPC Packet Privacy (RpcAuthnLevelPrivacyEnabled = 1): Microsoft mandated packet-level encryption and integrity authentication for all RPC communications. Connecting clients that do not negotiate this level fail immediately with error 0x0000011b.
  2. Restricting Point-and-Print (RestrictDriverInstallationToAdministrators = 1): Windows blocked standard users from automatically downloading and installing print drivers from shared printer hosts, producing error 0x00000709 or 0x0000007c.
  3. SMB v2/v3 Signing Checks: Security baselines drop unauthenticated guest connections, preventing machines in different workgroups or subnets from accessing shared printers without identical domain accounts.

Applying registry workarounds to bypass these mitigations leaves machines vulnerable to remote code execution and is regularly reverted by subsequent Windows cumulative updates.


2.3 Why Dedicated Hardware Print Servers & Raspberry Pi Fail

Many administrators attempt to bypass Windows sharing using alternative hardware, only to hit fundamental technical road-blocks:

  1. Hardware USB-to-LAN Print Server Dongles (TP-Link, D-Link, HP JetDirect):

    • These devices operate strictly as simple TCP socket gateways (Raw Port 9100 / AppSocket) or LPR/LPD forwarders.
    • They transmit data blindly to the USB port, expecting the printer to have an onboard PostScript or PCL processor.
    • With a host-based CAPT printer, the dongle sends bytes, but the printer has no onboard RIP to decode them and cannot perform the required bidirectional USB status handshake. Result: Zero pages printed, printer remains dead silent.
  2. Raspberry Pi with Linux CUPS (ccpd Nightmare):

    • Setting up CUPS on a Raspberry Pi or Linux box requires Canon's proprietary Linux drivers (cndrvcups-capt and the ccpd daemon).
    • Canon never officially compiled or supported these drivers for modern ARM64 Linux kernels.
    • The community reverse-engineered wrappers are notoriously unstable: the ccpd daemon regularly crashes upon USB re-enumeration, consumes 100% CPU when paper runs out, and silently drops multi-page print jobs.

2.4 Cross-Platform & Mobile Isolation

In modern environments:

  • macOS & iOS (Apple AirPrint) natively communicate via RFC 8011 IPP over HTTP/HTTPS with mDNS ZeroConf discovery. Apple devices have no support for Windows SMB RPC named pipes (\pipe\spoolss) and cannot run proprietary Windows GDI/CAPT drivers.
  • Android utilizes the Mopria standard or CUPS IPP Everywhere.
  • Without a protocol translation bridge, mobile and macOS devices are completely incapable of printing to host-based USB printers.

2.5 Spooler Deadlocks, Collisions & Interleaving

When multiple network clients print at the same time through Windows SMB:

  • The host spooler spawns concurrent asynchronous worker threads.
  • Host-based printers require a continuous, serialized stream of data into the USB pipe.
  • When concurrent print jobs compete for the single USB endpoint, the spooler either deadlocks, cancels jobs, or interleaves pages between separate users' documents.

The Solution: A True Network IP Printer Architecture

What Defines a "True IP Printer"?

A true network IP printer satisfies five fundamental criteria:

  1. Sovereign IP Address & Standard Ports: Accessible directly over IP (e.g. port 6310 for IPP, port 9200 for high-speed TCP) across subnets and VLANs.
  2. Industry-Standard Driverless Protocol (RFC 8011 IPP): Complies with IPP Everywhere / AirPrint. Any modern device prints using its built-in OS print dialog (Ctrl+P, Share -> Print) with zero external driver downloads.
  3. Decoupled Client & Host Rendering: The client outputs standard document formats (PDF, PWG-Raster, PostScript); the host bridge handles hardware-specific translation.
  4. Deterministic Sequential Queueing: Concurrency is managed through an atomic FIFO queue that guarantees zero spooler deadlocks and zero page interleaving.
  5. Zero-Configuration Discovery: Automatically announces its availability via UDP ZeroConf/mDNS on the local subnet.

How ZPrint Bridges Both Worlds

ZPrint runs as a lightweight, zero-dependency bridge service on the Windows PC physically connected to the USB printer. It decouples the network ingestion layer from the physical device execution:

[ Client Workstations & Mobile Devices ]
(iOS, Android, macOS, Linux, Windows)
       |
       | RFC 8011 IPP (HTTP / Port 6310) OR ZPrint ZeroLz4 TCP (Port 9200)
       v
+========================================================================+
|                       ZPrint Host Bridge Engine                        |
|                                                                        |
|  1. Network Ingestion Layer                                            |
|     - RFC 8011 IPP Server (application/ipp, application/pdf, PWG-Raster)|
|     - ZeroLz4 Wire Protocol Server (Pure C# 1.6 GB/s decompressor)     |
|     - UDP 9201 ZeroConf LAN Auto-Discovery Responder                   |
|                                                                        |
|  2. Serialized FIFO Job Queue (`PrintJobQueue`)                        |
|     - Atomic queue serializer with memory backpressure                 |
|     - Guarantees 0% page interleaving and 0% collision deadlocks       |
|                                                                        |
|  3. Win32 Direct Kernel Spooler Subsystem (`winspool.drv` RAW)         |
|     - Injects print stream directly into local spooler in RAW mode     |
|     - Native local Canon/HP driver handles CAPT/GDI USB communication  |
|     - COMPLETELY BYPASSES Windows SMB & MS-RPRN network security stack |
+========================================================================+
       |
       | USB Bidirectional CAPT / GDI Handshake
       v
[ Dumb USB Printer: Canon LBP 2900 / HP LaserJet 1020 ]

Direct Win32 RAW Spooling (winspool.drv)

Instead of exposing the Windows Spooler over the network via vulnerable SMB named pipes (\pipe\spoolss), ZPrint receives print jobs over standard HTTP/IPP or TCP and injects them locally into the Win32 print subsystem via low-level P/Invoke calls:

  • OpenPrinter
  • StartDocPrinter
  • WritePrinter
  • EndDocPrinter
  • ClosePrinter

By specifying data type "RAW", ZPrint delivers the payload directly to the locally installed official manufacturer driver (e.g. Canon official Windows driver).

Key Benefits:

  1. Complete Immunity to 0x0000011b and 0x00000709: Because the spooler call is 100% local to the host PC, Windows network RPC packet privacy checks (RpcAuthnLevelPrivacyEnabled) and Point-and-Print restrictions are never triggered.
  2. 100% Hardware Compatibility: The official Canon/HP driver handles the complex USB timing, bidirectional engine polling, and CAPT encoding locally with hardware perfection.
  3. No Driver Installation on Clients: Remote clients simply speak standard IPP or send documents to ZPrint; they never need the manufacturer driver.

Real-Time Wire Optimization: ZeroLz4 Protocol (1.6 GB/s)

When printing high-resolution 1200 DPI graphics or complex drawings, uncompressed raster print files can easily exceed 40–80 MB per document. On crowded office 2.4 GHz Wi-Fi networks, this causes severe network congestion and transmission delays.

ZPrint integrates ZeroLz4, a pure C# high-speed compression engine:

  • 1.6 GB/s decompression speed on standard multi-core CPUs with zero heap allocations (Span<T> and pooled memory).
  • 70%–85% bandwidth reduction, compressing a 30 MB document down to 4 MB for lightning-fast over-the-wire transit.
  • Sub-millisecond transfer times, ensuring immediate printer response.

Thread-Safe Atomic FIFO Serialization

To eliminate spooler deadlocks and corrupted output from simultaneous printing:

  • ZPrint's PrintJobQueue utilizes lock-free synchronization primitives (Channel<T> and atomic counters).
  • When multiple clients hit print at the same instant, ZPrint queues the jobs sequentially, writes them to isolated buffer storage, and streams them to the local printer one by one.
  • Guarantees 0% page interleaving and eliminates concurrent buffer overflows.

Architecture Overview

                      +------------------------------------------+
                      |               Client Nodes               |
                      |                                          |
                      |  [macOS / iOS]   [Linux]   [Windows PC]  |
                      |    (AirPrint)    (CUPS)      (Ctrl+P)    |
                      +-------+-------------+------------+-------+
                              |             |            |
             RFC 8011 IPP     |             |            |  ZPrint CLI / Tool
        (application/ipp)     |             |            |  (ZeroLz4 TCP)
                              v             v            v
                      +------------------------------------------+
                      |         ZPrint Host Server Node          |
                      |                                          |
                      |  +--------------------+  +------------+  |
                      |  | ZPrintIppServer    |  | TCP Server |  |
                      |  | (Port 6310)        |  | (Port 9200)|  |
                      |  +---------+----------+  +-----+------+  |
                      |            |                   |         |
                      |            |   (ZeroLz4 Decomp)|         |
                      |            +---------+---------+         |
                      |                      |                   |
                      |                      v                   |
                      |            +-------------------+         |
                      |            |   PrintJobQueue   |         |
                      |            |  (FIFO Serializer)|         |
                      |            +---------+---------+         |
                      |                      |                   |
                      |                      v                   |
                      |            +-------------------+         |
                      |            |   WindowsSpooler  |         |
                      |            | (winspool.drv RAW)|         |
                      |            +---------+---------+         |
                      |                      |                   |
                      +----------------------|-------------------+
                                             v
                             [Canon LBP 2900 / HP 1020 / USB]

Feature Comparison

Feature Windows SMB Share (\\host\printer) Dedicated Hardware Print Server ZPrint Bridge
Canon LBP 2900 / CAPT Support ❌ Unreliable / Crashes ❌ Fails (No CAPT on hardware) 100% Native & Stable
0x0000011b & 0x00000709 Errors ❌ Frequent ⚠️ Protocol Mismatches Immune (Direct RAW Spool)
Driverless Printing (No Client Driver) ❌ Driver required on every PC ⚠️ Requires PostScript/PCL Native (AirPrint / IPP)
macOS & iOS (AirPrint) ❌ Not supported ⚠️ Model-dependent Plug & Play
Android & Linux (CUPS) ❌ Complex SMB setup ⚠️ PCL/PS only Standard IPP Everywhere
Wire Compression ❌ None (Raw network SMB) ❌ None ZeroLz4 (1.6 GB/s)
Concurrent Job FIFO Queue ⚠️ Spooler lockups ⚠️ Hardware buffer overflow Thread-safe FIFO Queue
Automatic LAN Discovery ⚠️ NetBIOS / WS-Discovery lags ⚠️ Fixed IP / Web GUI UDP 9201 in < 1.5s
Cost Free (but buggy) $40 – $100 per device Free & Open Source

Quick Start

1. Run Host Server

Connect your printer to a Windows PC via USB and start the server:

# Automatically picks your Windows default printer
zprint server

# Or specify a printer explicitly
zprint server --printer "Canon LBP2900"

2. Run in the Background

To detach from the console and run silently in the background:

zprint server --printer "Canon LBP2900" --background

The console window immediately hides. Logs are written to %LOCALAPPDATA%\ZPrint\zprint-server.log.


Client Setup Walkthrough

Windows 10 / 11 (Microsoft IPP Class Driver)

No Canon or manufacturer driver needed on the client PC!

  1. Open Settings -> Bluetooth & devices -> Printers & scanners -> Add device.
  2. Click Add manually (The printer that I want isn't listed).
  3. Select Select a shared printer by name and enter:
    http://<SERVER_IP>:6310/ipp/printers/canon
    
  4. Click Next. Windows automatically binds the native Microsoft IPP Class Driver.
  5. You're ready to print! Use Ctrl+P in any application.

macOS (AirPrint / Driverless IPP)

  1. Open System Settings -> Printers & Scanners -> Add Printer, Scanner, or Fax.
  2. Select the IP tab (Globe icon).
  3. Enter settings:
    • Address: <SERVER_IP>:6310
    • Protocol: Internet Printing Protocol - IPP
    • Queue: /ipp/
    • Name: Canon LBP2900 (Network)
    • Use: Generic PostScript Printer (or Auto Select)
  4. Click Add.

Linux (CUPS / IPP Everywhere)

Run via terminal or add through GNOME / KDE Printer Settings:

# Register driverless IPP printer with CUPS
lpadmin -p ZPrint_Canon -E -v ipp://<SERVER_IP>:6310/ipp/ -m everywhere

# Verify printer status
lpstat -p ZPrint_Canon

iOS & iPadOS (AirPrint)

  1. Ensure your iPhone/iPad is connected to the same Wi-Fi network.
  2. In any app (Safari, Photos, Mail, Files), tap the Share button -> Print.
  3. Tap Select Printer.
  4. Tap Canon LBP2900 (detected automatically via IPP/mDNS).
  5. Tap Print.

Android (Mopria / Default Print Service)

  1. Open Settings -> Connected devices -> Connection preferences -> Printing.
  2. Select Default Print Service or Mopria Print Service.
  3. Choose Add printer by IP address:
    • Address: <SERVER_IP>:6310
  4. Print directly from Chrome, Google Drive, or Gallery.

ZPrint CLI & Drag-and-Drop Client

ZPrint also provides a high-performance desktop client for batch printing:

# Drag & drop any PDF/file onto zprint.exe, or run:
zprint print invoice.pdf

# Specify page ranges and multiple copies:
zprint print contract.pdf --pages "1, 3, 5-8" --copies 2

# Discover all active ZPrint servers on the LAN:
zprint list

Output:

Machine Name       IP Address       TCP Port IPP Port Shared Printers
------------------------------------------------------------------------------
DESKTOP-PRINT-01   192.168.1.105    9200     6310     Canon LBP2900

Host Server Administration

User Login Autostart

Configures ZPrint to start silently in the background whenever the current user logs into Windows:

# Enable autostart with specific printer
zprint autostart enable --printer "Canon LBP2900"

# Check current autostart status
zprint autostart status

# Disable autostart
zprint autostart disable

Platform Implementation: Windows Registry HKCU\Software\Microsoft\Windows\CurrentVersion\Run | Linux ~/.config/autostart/zprint.desktop | macOS ~/Library/LaunchAgents/.


System Boot Service (Unattended SYSTEM)

Configures ZPrint to start as a background system service when the machine boots up, even before any user logs in.

Important

Must be executed from an elevated terminal (Run as Administrator on Windows, or sudo on Linux).

# Install and register system boot task
zprint service install --printer "Canon LBP2900"

# Start the service immediately
zprint service start

# Check service status
zprint service status

# Stop service
zprint service stop

# Uninstall service
zprint service uninstall

Platform Implementation: Windows Task Scheduler (schtasks.exe /sc onstart /ru SYSTEM /rl HIGHEST) | Linux systemd unit (/etc/systemd/system/zprint.service).


Automatic In-Place Updates (ZUpdate)

ZPrint integrates seamlessly with ZeroUniverse's ZUpdate engine for atomic, in-place binary upgrades:

# Check if a new version is available on GitHub Releases
zprint update --check

# Download package and perform atomic in-place upgrade
zprint update

# Force download and reinstall current or newer version
zprint update --force

# Suppress user confirmation prompts during update execution
zprint update --silent

CLI Reference

Usage: zprint <command> [options]

Commands:
  server              Start the print server daemon on the host PC
  print <file>        Send a document to a ZPrint server
  list                Discover all active ZPrint servers on the LAN
  autostart <action>  Configure user login autostart (enable, disable, status)
  service <action>    Manage system boot service (install, uninstall, start, stop, status)
  update              Check or perform atomic in-place updates via ZUpdate
  install-printer     Display driverless IPP setup instructions for all platforms

Server Options:
  --port <port>       Custom TCP port for ZPrint protocol (default: 9200)
  --ipp <port>        Custom IPP port for AirPrint/driverless clients (default: 6310)
  --printer <name>    Target local printer name (default: Windows default printer)
  --background, -b    Run daemon silently in background (hides console window)
  --no-ipp            Disable RFC 8011 IPP server
  --no-discovery      Disable UDP LAN auto-discovery responder

Print Options:
  --server <ip:port>  Target ZPrint server (auto-discovered if omitted)
  --printer <name>    Target printer name on remote server
  --pages <range>     Page range filter (e.g., "1, 3, 5-8", "2-")
  --copies <num>      Number of copies (default: 1)

Update Options:
  --check             Check GitHub Releases without downloading or replacing binaries
  --force             Force download and reinstall even if already up-to-date
  --silent            Execute update without interactive console prompts

Zero-Dependency Architecture

ZPrint adheres strictly to the ZeroUniverse engineering philosophy:

  • 0 External NuGet Packages: Every byte of networking, compression, serialization, and protocol parsing is implemented with pure C# BCL.
  • Ultra-Lightweight Footprint: Memory usage typically stays under 15 MB RAM, making it ideal for running continuously in the background on office PCs or dedicated print boxes.
  • Sovereign Reliability: No third-party dependency vulnerabilities, no version drift, and instant cold startup.

Building & Testing

Prerequisites

Build Solution

dotnet build ZPrint.slnx

Run Unit Tests

dotnet test ZPrint.slnx

Publish Lightweight Single-File Executable

In accordance with ZeroUniverse publication guidelines (framework-dependent single file):

dotnet publish src/ZPrint.Tool/ZPrint.Tool.csproj -c Release -r win-x64 --self-contained false -p:PublishSingleFile=true -o publish/zprint-win-x64

License

This project is licensed under the MIT License.
Copyright (c) 2026 Phong Võ (kzxl) / ZeroUniverse. All rights reserved.

About

High-performance, zero-config network print bridge and RFC 8011 IPP server that turns USB host-based/GDI/CAPT printers into smart LAN printers for Windows, macOS, Linux, iOS & Android.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages