Several labels in one body
Every^XA…^XZ in the body becomes its own page, and ^PQ adds copies. Send them as raw ZPL like a single label:
X-Page-Count response header tells you how many pages the PDF has. With a live key, every page is billed as one label, and X-Labels-Billed shows the total. See Authentication.
Several files as multipart
To render a batch of ZPL files, upload them asmultipart/form-data, one file part per file:
- Every part with a filename, or named
file,filesorzpl, counts as a ZPL file. Other form fields are ignored. - Each file is rendered with a fresh printer state. Settings such as
^PWand^LH, and stored graphics or formats, don’t carry over to the next file. - Pages follow the upload order. The
X-File-Page-Countsheader lists the pages per file, for example2, 1, 1. - A file can contain several labels itself.
One page as PNG
PNG output is a single page. Choose it withpage, starting at 1 and counted across all files:
Compressed uploads
Labels that embed bitmaps (~DG, ^GF) are large but compress well. Send the body gzip-compressed with a Content-Encoding: gzip header (deflate works too):
-F multipart body itself. To send a compressed batch of files, build the multipart body yourself and gzip it:
Limits
A larger body returns
413, a corrupt compressed body 400, and an unsupported Content-Encoding 415. For bigger batches, split them over several requests.