CloudToBrowserPrint
zplcloud2print: local HTTP/HTTPS print service (127.0.0.1:9100 / 9101) for Windows, macOS, Linux and Raspberry Pi. Web pages call it via JavaScript to discover printers and print ZPL, files and URLs. JSPM-compatible request model.
Functions
- Device discovery - Windows spooler, CUPS (Linux/macOS), network (TCP 9100), Bluetooth SPP.
- Printing - raw ZPL, URLs, blobs from the browser (multipart); several jobs per request.
- Conversion - PDF, Office (DOC/DOCX/XLS/XLSX via LibreOffice), images (TIF/JPG/PNG/GIF/…) and TXT → ZPL (
^GF), optionally print directly. - Barcode decoding - image →
{type, data}(ZBar; macOS: Apple Vision). - Bidi - TCP, serial (COM/TTY), Bluetooth, parallel port (LPT), IPP (RFC 2911); session-based.
- Print Server Mode - all functions over a SignalR WebSocket (
/hubs/print) without HTTP polling. - Job trace - every operation with
queued → printing → ok | failed, bytes, errors, timings; live via SignalR.
Demo page: zplcloud.com/cloudtobrowserprint (connection types, hub status, job trace, network printer management).
Installation
The installer detects OS and architecture and downloads the binary from https://zplcloud.com/downloads/.
macOS / Linux / Raspberry Pi
Targets: osx-x64, osx-arm64, linux-x64, linux-arm64, linux-arm. The installer writes a default printers.json and installs the HTTPS certificate (macOS login keychain; Linux NSS DB for Chrome/Chromium/Firefox; no sudo). Skip with ZPLCLOUD_NO_CERT=1.
Windows (PowerShell, no admin)
Installs to %LOCALAPPDATA%\zplcloud2print\zplcloud2print.exe, adds the directory to the user PATH. Targets: win-x64, win-x86, win-arm64.
Start
The start banner prints version, build date, debug/log status and the effective printers.json path. If a port is in use, the holding process is named (Windows GetExtendedTcpTable, Linux ss -ltnp, macOS lsof -nP).
Service mode
| System | Mechanism | Start |
|---|---|---|
| Linux / Raspberry Pi | systemd unit zplcloud2print.service (Restart=always, RestartSec=5) | at boot (sudo required, detected automatically) |
| macOS | launchd LaunchAgent ~/Library/LaunchAgents/com.zplcloud.cloudtobrowserprint.plist (KeepAlive=true) | at login, no admin |
| Windows | scheduled task zplcloud2print (schtasks ONLOGON, /RL LIMITED) | at login, no admin |
Platform matrix
| Feature | Windows | macOS | Raspberry Pi (arm) | Linux x64 |
|---|---|---|---|---|
PDF → ZPL (^GF) | PDFium | PDFium | PDFium | PDFium |
| Images (TIF/JPG/PNG/GIF/…) → ZPL | FreeImage | FreeImage | FreeImage | FreeImage |
| Office (DOC/DOCX/XLS/XLSX) → PDF → ZPL | LibreOffice | LibreOffice | LibreOffice | LibreOffice |
| Barcode decoding | ZBar | Apple Vision | ZBar | ZBar |
| Print: installed printers (spooler) | winspool | – | – | – |
| Print: CUPS | – | lp -d … -o raw | ✓ | ✓ |
| Print: network (raw TCP 9100) | ✓ | ✓ | ✓ | ✓ |
| Print: Bluetooth (SPP) | ✓ | ✓ | ✓ | ✓ |
| Bidi: serial (COM/TTY) | ✓ | ✓ | ✓ | ✓ |
| Bidi: parallel port (LPT) | ✓ | – | – | – |
| IPP (RFC 2911) | ✓ | ✓ | ✓ | ✓ |
| HTTPS certificate (trust store) | Store | Keychain | NSS | NSS |
| Service mode | schtasks | launchd | systemd | systemd |
Verified on real hardware: Windows, macOS arm64, Raspberry Pi armhf, Linux x64.
HTTP API (local)
| Endpoint | Method | Description |
|---|---|---|
| /available?types=… | GET | Device list; filter network,usb,driver,cups,bluetooth (BT scan only on request). |
| /write | POST | Send: {device, data} | {device, url} | multipart json + blob. |
| /read | POST | Read from the printer (network/BT with return channel). |
| /convert | POST | File → ZPL; with device + action:"print" = convert and print. |
| POST | Several jobs: {jobs:[{device, data|url}]}. | |
| /decode | POST | Image → {barcodes:[{type,data}]}. |
| /comm/tcp · /comm/serial/… · /comm/bt/… · /comm/parallel | POST | Bidi sessions. |
| /ipp | POST | IPP print job (RFC 2911). |
| /jobs · /jobs/{id} | GET | Job trace (status, bytes, errors, timings). |
| /config/printers | GET | Configured network printers (printers.json). |
| /config/printers | POST | Add: {host, port?, name?} → {ok, message, printers}. |
| /config/printers/remove | POST | Remove by host or name: {hostOrName} → {ok, message, printers}. |
| /hubs/print | SignalR | Print Server Mode: all functions over WebSocket, live job trace. |
Web client (zplcloud2print.min.js)
One minified file, SignalR embedded, promise API.
Port override: ?zbpPort=19200 in the page URL. onPendingChange(cb) reports running operations (loader state).
printers.json
Read from next to the binary first, otherwise from the user folder; changes are picked up live. Contains network printers, allowedOrigins (other origins get 403; localhost, file:// and curl are always allowed), proxy settings and optional watchers.
- Windows:
%LOCALAPPDATA%\zplcloud2print\printers.json - macOS:
~/Library/Application Support/zplcloud2print/printers.json - Linux / Raspberry Pi:
~/.config/zplcloud2print/printers.json(or$XDG_CONFIG_HOME)