ZPLServer for Windows, Linux & macOS 2.0: TIFF Output, Page Layouts and Error Replies Over Raw TCP
ZPLServer 2.0 released: TIFF Output, Page Layouts and Error Replies Over Raw TCP
ZPLServer is a local service that receives ZPL and turns it into images or documents. You send it ZPL over HTTP or a raw TCP socket, like a network label printer. Version 2.0 makes all the rendering options of our ZPL engine available, and it closes a gap many of you reported: knowing when a job fails.
TIFF output, your way
TIFF joins PNG, JPG, PDF, PCX and PCL as an output format. You choose the pixel format and the compression, either in the Settings page or per job. A job with several labels produces a single multipage TIFF, the same as PDF and PCL.
curl -X POST http://localhost:47321/render -H "Content-Type: application/json" \
-d '{"zplCommands":"^XA^FO30,40^ADN,36,20^FDHello^FS^XZ",
"fileFormat":"TIFF","tiffPixelFormat":"Bilevel"}' -o label.tif
Labels on real pages
Thermal labels don't always end up on a thermal printer. For PDF, TIFF and PCL you can now set a fixed paper size, such as Letter, A4 or any custom size, in portrait or landscape. ZPLServer centers each label on the page, ready for an office printer or a document archive. You can also set the PDF title, author and other metadata.
More control over every render
- Rotate the output.
- Add a watermark or background image from a file, a URL or Base64.
- Invert colors.
- Output only some of the labels in a job.
- Upload custom fonts, graphics and stored ZPL formats (
^XG,^XF) once in Settings, and every job can use them.
For integrations that need more than a picture, /render can also return the rendered elements as JSON: every text, barcode and graphic, with its position and properties.
Know when a job fails
Until now, a raw TCP job that failed left only a log entry, so the sending application never found out. Now ZPLServer writes a one-line JSON reply back on the same socket:
{"status":"error","code":"WRITE_FAILED","message":"Could not write output file: Access to the path is denied."}
The reply carries a stable code your code can check: invalid payload, rendering error, an output file that can't be written, an unreachable webhook, and more. By default only failures get a reply. Set it to always and successful jobs are confirmed too, with the paths of the saved files:
with socket.create_connection(("127.0.0.1", 47321)) as s:
s.sendall(json.dumps(job).encode("utf-8"))
s.shutdown(socket.SHUT_WR) # tell ZPLServer the job is complete
result = json.loads(s.makefile().readline())
ZPLServer replies once the client closes its sending side of the socket. If your client keeps the socket open while it waits for the answer, set an idle timeout in Settings and the job ends after that much silence. The /render endpoint uses the same error codes, returned with HTTP 400 or 500.
Smoother installs and upgrades
To upgrade, run the install script of the new version. It stops the service, replaces the binary, starts the service again and keeps your settings, license and custom files. On Windows the service now restarts itself if it crashes, and you can add the firewall rule in the same step with -AddFirewallRule.
ZPLServer 2.0 runs on Windows x64 and x86, Linux x64 and ARM64 (including Raspberry Pi), and macOS on Apple Silicon and Intel. The macOS build is notarized by Apple.
| Tweet |
|