Skip to main content

Concepts

The bridge model​

Presto is a single native daemon, prestod, that runs on the same machine as the browser. It serves the WebSocket API, a REST mirror, and the admin UI all on one loopback origin (127.0.0.1:31075).

your web app ── presto.js ──wss──▶ prestod (127.0.0.1:31075) ──▶ printer

A web page loads the JS client, which opens a secure WebSocket to the daemon, authenticates, and submits print jobs. The daemon serializes each job onto the printer's transport and pushes per-label results back as events.

Printers & aliases​

Printers are registered as aliases — each gets a stable id that web apps reference. The alias survives OS-level renames, and web origins only ever see aliases, never the raw OS print queues.

Transports​

TransportHowFeedback
TCP (9100)Raw JetDirect over TCP. Bidirectional — status and RFID read-back on the same socket.Full
USB (usblp)Linux /dev/usb/lp*, bidirectional.Full
SpoolerWindows print spooler (RAW). Write-only.spooler only
SerialRS-232 (device:baud).Varies

TCP is the primary transport — it's bidirectional, which is what makes real status and RFID read-back possible.

Jobs​

A job is submitted either as print.raw (raw printer-language bytes) or print.template (a stored template plus per-label parameters for a batch). Presto passes the bytes through 8-bit-transparent — it never re-encodes your payload.

Every job carries a verification level that bounds what Presto will claim:

  • spooler — the spooler accepted the bytes.
  • printer — the printer confirmed it (bidirectional transport).
  • rfid — per-label tag encoding was verified.

Job states​

Queued → Sending → Sent → Done | Failed | Cancelled

A completed job reports one of done(verified), done(voided, n), or done(unverified) depending on the verification the transport supported.

RFID feedback​

For RFID jobs, Presto arms verification, sends, then reads back each label's result and automatically reprints only the voided labels — not the whole batch, which would waste tags. A per-label result is { index, printed, encoded?, voided?, fault?, epc? }. See ZPL & RFID.

Languages​

ZPL II is the deeply-supported language (transforms, status, RFID, calibration). EPL2, TSPL2, SBPL, CPCL, and ESC/POS are recognized and passed through; anything else is passed through tagged. Jobs can declare their language explicitly, which always wins over auto-detection.