https://github.com/syfaro/zpl-printer
Web interface for ZPL templating and printing
https://github.com/syfaro/zpl-printer
Last synced: about 1 year ago
JSON representation
Web interface for ZPL templating and printing
- Host: GitHub
- URL: https://github.com/syfaro/zpl-printer
- Owner: Syfaro
- Created: 2023-07-04T17:33:40.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-06-01T04:00:01.000Z (about 1 year ago)
- Last Synced: 2025-06-03T16:53:50.545Z (about 1 year ago)
- Language: Rust
- Size: 206 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# zpl-printer
A web tool for easily templating and printing ZPL over HTTP. Heavily inspired by
[zpl-rest](https://github.com/mrothenbuecher/zpl-rest/tree/master).
It utilizes the [Tera](https://keats.github.io/tera/docs/#templates) template
engine to construct ZPL.

## Usage
Build with cargo. It depends on PostgreSQL to store data, set the `DATABASE_URL`
environment variable before running. The web UI available on port 3000 allows
configuring printers, label sizes, and labels.
The playground allows quick iteration of label design thanks to the label
preview service provided by [Labelary](http://labelary.com).
Labels can be saved and then printed via API.
### API
#### `POST /api/v1/print`
Prints a label. It requires a JSON-encoded body with the following contents:
```jsonc
{
"printer_id": "", // The printer's ID
"label_id": "", // The label's ID
"data": {} // Arbitrary key-value data passed to label's template
}
```