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

curl -fsSL https://zplcloud.com/install-cloudtobrowserprint.sh | sh
# or: wget -qO- https://zplcloud.com/install-cloudtobrowserprint.sh | sh
zplcloud2print --version

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)

irm https://zplcloud.com/install-cloudtobrowserprint-pshell | iex
zplcloud2print --version

Installs to %LOCALAPPDATA%\zplcloud2print\zplcloud2print.exe, adds the directory to the user PATH. Targets: win-x64, win-x86, win-arm64.

Start

zplcloud2print                     # http://127.0.0.1:9100 + https://127.0.0.1:9101
zplcloud2print 19200 19201         # other ports
zplcloud2print --install-cert      # HTTPS certificate into the trust store (Safari on https pages)
zplcloud2print --debug             # debug output
zplcloud2print --log               # logs/debug.log next to the binary
zplcloud2print --log=C:\path\debug.log
zplcloud2print --add-printer 192.168.1.50:9100 ZD421
zplcloud2print --remove-printer ZD421

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

zplcloud2print --service-install
zplcloud2print --service-uninstall
SystemMechanismStart
Linux / Raspberry Pisystemd unit zplcloud2print.service (Restart=always, RestartSec=5)at boot (sudo required, detected automatically)
macOSlaunchd LaunchAgent ~/Library/LaunchAgents/com.zplcloud.cloudtobrowserprint.plist (KeepAlive=true)at login, no admin
Windowsscheduled task zplcloud2print (schtasks ONLOGON, /RL LIMITED)at login, no admin
# Status / logs
Linux/Pi : systemctl status zplcloud2print   |  journalctl -u zplcloud2print -f
macOS    : launchctl list | grep cloudtobrowserprint   |  /tmp/zplcloud2print.log
Windows  : schtasks /Query /TN zplcloud2print          |  %LOCALAPPDATA%\zplcloud2print\logs\debug.log

Platform matrix

FeatureWindowsmacOSRaspberry Pi (arm)Linux x64
PDF → ZPL (^GF)PDFiumPDFiumPDFiumPDFium
Images (TIF/JPG/PNG/GIF/…) → ZPLFreeImageFreeImageFreeImageFreeImage
Office (DOC/DOCX/XLS/XLSX) → PDF → ZPLLibreOfficeLibreOfficeLibreOfficeLibreOffice
Barcode decodingZBarApple VisionZBarZBar
Print: installed printers (spooler)winspool
Print: CUPSlp -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)StoreKeychainNSSNSS
Service modeschtaskslaunchdsystemdsystemd

Verified on real hardware: Windows, macOS arm64, Raspberry Pi armhf, Linux x64.

HTTP API (local)

EndpointMethodDescription
/available?types=…GETDevice list; filter network,usb,driver,cups,bluetooth (BT scan only on request).
/writePOSTSend: {device, data} | {device, url} | multipart json + blob.
/readPOSTRead from the printer (network/BT with return channel).
/convertPOSTFile → ZPL; with device + action:"print" = convert and print.
/printPOSTSeveral jobs: {jobs:[{device, data|url}]}.
/decodePOSTImage → {barcodes:[{type,data}]}.
/comm/tcp · /comm/serial/… · /comm/bt/… · /comm/parallelPOSTBidi sessions.
/ippPOSTIPP print job (RFC 2911).
/jobs · /jobs/{id}GETJob trace (status, bytes, errors, timings).
/config/printersGETConfigured network printers (printers.json).
/config/printersPOSTAdd: {host, port?, name?}{ok, message, printers}.
/config/printers/removePOSTRemove by host or name: {hostOrName}{ok, message, printers}.
/hubs/printSignalRPrint Server Mode: all functions over WebSocket, live job trace.

Web client (zplcloud2print.min.js)

One minified file, SignalR embedded, promise API.

<script src="https://zplcloud.com/cloudtobrowserprint/zplcloud2print.min.js"></script>
<script>
  var bp = window.zplcloud2BrowserPrint;

  bp.getDevices(['network','driver']).then(function (devices) {
    var d = devices[0];
    return d.send('^XA^FO50,50^A0N,40^FDHello^FS^XZ');   // raw ZPL
    // d.sendUrl(url);  d.sendFile(blob);  d.convert(blob, {dpi:203});
  });

  // printers.json (live reload)
  bp.addNetworkPrinter('192.168.1.50', 9100, 'ZD421').then(console.log);  // {ok, message, printers}
  bp.getNetworkPrinters().then(console.log);                              // [{host, port, name}]
  bp.removeNetworkPrinter('192.168.1.50');                               // host or name

  // Print Server Mode (SignalR)
  bp.hub.connect({ port: 9100 }).then(function () {
    bp.hub.onJobResult = function (id, ok, error) { console.log(id, ok, error); };
    return bp.hub.getDevices(['network']);
  });
</script>

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)
{
  "networkPrinters": [{ "host": "192.168.1.50", "port": 9100, "name": "ZD421" }],
  "allowedOrigins": ["https://zplcloud.com"],
  "printJobsWatcher": { "enabled": false, "command": "… {printer} {document} {id}", "pollIntervalMs": 2000 },
  "printersWatcher": { "enabled": false, "pollIntervalMs": 3000 }
}