How kaijesussek/zplprinterpro works
ZplPrinterPro parses ZPL II into label and printer-memory representations, rasterizes labels, and serves the result through a TCP print server and HTTP interface. The main workflow is a ZPL client sending a session to the server, which parses each label, renders a PNG, and archives the raw ZPL span and image. The server also handles host-status queries and exposes labels, printer state, and storage to the web UI. The README documents additional parser and renderer capabilities; some server wiring is inferred from that documentation because its implementation was not sampled.
Main entry points: tcp.rs TCP Sessions · cmd.rs Command Dispatch · ir.rs Label IR · mod.rs Bitmap and PNG
Components 20
ZPL Parsing
- Stream Scanner
zpl/src/scanner.rs - Command Dispatch
zpl/src/cmd.rs - Parse Context
zpl/src/state.rs - Label IR
zpl/src/ir.rs - Printer Memory
zpl/src/memory.rs - Codepages
zpl/src/codepage.rs
Label Rendering
- Graphics
zpl/src/render/draw.rs - Text Rendering
zpl/src/render/text.rs - Barcode Rendering
zpl/src/render/barcode.rs - Barcode Encoders
zpl/src/bc2d.rs - Bitmap and PNG
zpl/src/render/mod.rs
Print Server
- TCP Sessions
zpl-server/src/tcp.rs - Host Queries
zpl-server/src/hs.rs - Session Protocol
zpl-server/src/proto.rs - Label Archive
zpl-server/src/archive.rs - Application State
zpl-server/src/state.rs
Other components
- ZPL Client
- Browser User
Connections 25
- ZPL Client → TCP Sessions: sends ZPL
- TCP Sessions → Session Protocol: processes sessions
- TCP Sessions → Stream Scanner: parses stream
- Stream Scanner → Command Dispatch: yields tokens
- Command Dispatch → Parse Context: updates state
- Command Dispatch → Label IR: builds labels
- Command Dispatch → Printer Memory: stores objects
- Command Dispatch → Codepages: decodes text
- TCP Sessions → Host Queries: answers queries
- TCP Sessions → Label IR: renders parsed labels
- TCP Sessions → Label Archive: archives raw and PNG
- Label IR → Graphics: supplies fields
- Label IR → Text Rendering: supplies text fields
- Label IR → Barcode Rendering: supplies barcode fields
- Barcode Rendering → Barcode Encoders: encodes symbols
- Graphics → Bitmap and PNG: paints graphics
- Text Rendering → Bitmap and PNG: paints text
- Barcode Rendering → Bitmap and PNG: paints barcodes
- Printer Memory → Bitmap and PNG: provides stored objects
- Bitmap and PNG → Label Archive: provides PNG
- TCP Sessions → Application State: updates state
- Browser User → Web UI: uses interface
- Web UI → HTTP API: requests API
- HTTP API → Label Archive: reads label archive
- HTTP API → Application State: reads and updates