take part in this little survey
zpl-rest provides the following
- REST-API to manage labels (written in ZPL), printer and to print these labels
- a simple graphical user interface for this REST-API
- you can use mustache in your ZPL-Code
- you can preview the result of your ZPL-Code
- you can test print your ZPL-Code
- you can review and reprint printjobs
- you can use placeholder in your ZPL labels (${varname}) which will be replaced through the API e.g.:
^XA
^LH0,0
^MTT
^A0N,36,36
^FO236,71
^FD${sometext}^FS
^XZ
which you can replace with the following POST-request to /rest/print:
{
printer:"printer id",
label:"id of the label",
job_id:"optional",
data : {
sometext: "hello world"
}
}download this repo und run npm start
- overview page with statistics

- reprint page, here you can print / review old printjobs

- label page, with label preview

| Method | Path | parameter | description |
|---|---|---|---|
| get | /rest/printer | none | list of all printers |
| get | /rest/label | none | list of all labels |
| get | /rest/jobs | none | list of all printjobs |
| get | /rest/preview | ?printer=printer_id&label=label_id(&zpl=...) | generates a preview of the label using this service as base64 |
| post | /rest/print | {printer:"printer_id...",label:"label_id...", data: {...}(,job_id:"...")} | actual print |
| post | /rest/reprint/(:jobid) | ({printer:"printer_id...", zpl:"..."}) | reprint, change printer if wanted or ZPL-code |
| post | /rest/preview | {printer:"printer_id...",label:"label_id..."(,zpl:"...")} | generates a preview of the label using this service as base64 |
| post | /rest/printer | to add : {address:"..",name:"...",density:"..."} for update {_id:"...",address:"..",name:"...",density:"..."} | add or update a printer |
| post | /rest/label | to add : {name:"...",zpl:"...",width:"...",height:"..."} for update {_id:"...",name:"...",zpl:"...",width:"...",height:"..."} | add or update a label |
| delete | /rest/printer/(:printerid) | none | removes a printer with the given id |
| delete | /rest/label/(:labelid) | none | removes a label with the given id |
You can optionally supply a job_id when calling /rest/print. This identifier is stored with the print job and displayed in the dashboard failure list and on the reprint page to make it easier to match REST jobs with your own system.
you can edit the config.js with following options:
| Option | Type | description | Default |
|---|---|---|---|
| port | int | port for the RESTAPI | 8000 |
| websocket_port | int | websocket port for the frontend | 8001 |
| public | bool | if false server only reachable for localhost |
true |
| secret | string | the session secret |