ZPL vs PDF: Choose the Right Format for Shipping Labels
ZPL gives compatible thermal printers direct label instructions. PDF works across more printer types. Compare quality, compatibility, and automation before choosing your shipping-label format.
By the PrintScaler team · · 10 min read
For shipping labels, choose ZPL when your printer supports it and your label source can generate it at the correct resolution. Choose PDF when you need broader printer compatibility, an easily previewed document, or support for mixed office and thermal printers. Neither format guarantees a readable barcode: the label dimensions, rendering settings, printer configuration, and physical print quality still matter.
ZPL vs PDF: the practical differences
ZPL is a printer command language. A ZPL label contains instructions that tell a compatible printer where to place text, barcodes, graphics, and other elements. PDF is a document format that a printing system renders before sending the result to the printer.
That difference affects how you generate labels, troubleshoot failures, and support customers with different hardware.
| Decision factor | ZPL | |
|---|---|---|
| Printer compatibility | Requires a printer that understands the ZPL commands used | Works through a suitable PDF printing path and printer driver |
| Previewing | Requires a ZPL-aware preview or a test print | Opens in standard PDF viewers |
| Label layout | Often expressed in printer dots | Defined by document page dimensions |
| Barcode rendering | Can use native printer barcode commands | Barcodes are rendered from PDF content |
| Scaling risks | Wrong resolution or dimensions can distort the layout | Fit-to-page, margins, and incorrect paper size can alter output |
| Mixed printer fleets | Requires language and resolution checks | Usually easier to support across different printer types |
| Typical fit | Standardized thermal-label stations | Mixed hardware, document workflows, and human review |
The most important rule: match the format to the printer and the available source file, not just to a preferred file extension. A thermal printer is not automatically a ZPL printer, and a PDF is not automatically an office-paper document.
When ZPL is the better shipping-label format
You control a compatible thermal-printer fleet
ZPL is a strong choice when your warehouse uses printers that support the required ZPL commands. Your application can send a compact stream of instructions rather than relying on a PDF page-rendering workflow.
However, confirm support for the specific printer model and configuration. A printer may support another language, offer a language-emulation mode, or implement only part of a command set. A brand name alone is not enough to establish compatibility.
Check these details before committing:
- Supported printer language and active language mode.
- Printer resolution, such as 203 or 300 DPI.
- Actual label width and length.
- Whether the label source offers output for that resolution.
- Any command restrictions in a compatible or emulated implementation.
Your label source provides native ZPL
If your shipping service already returns ZPL for the target printer, sending that original output is often simpler than converting it to PDF and rendering it again.
Keep the returned bytes intact. Do not treat the label as a template to edit casually: carrier labels can include routing information, barcodes, and graphics whose structure should remain unchanged.
ZPL is especially useful when your application creates its own warehouse labels using text and native barcode commands. But a ZPL file can also contain downloaded graphics, so not every ZPL label is small or primarily command-based.
You want to reduce rendering variables
Direct RAW delivery removes PDF-specific choices such as fit-to-page and page rotation from the label path. That can make a standardized workstation easier to maintain.
It does not remove all variables. Printer darkness, speed, media calibration, resolution, and physical condition still affect the result. ZPL is a different rendering path, not a guarantee of perfect labels.
For implementation details beyond the format decision, see the guide to printing ZPL from cloud applications.
When PDF is the better shipping-label format
Your customers use different printer types
PDF is usually the more practical starting point for a SaaS product serving an unknown mix of printers. One customer may use a dedicated thermal printer; another may print labels on a laser printer through an installed driver.
You still need appropriate paper settings, but you do not have to assume that every destination understands ZPL.
This matters when users bring their own hardware. Supporting PDF first can reduce the number of printer-language decisions they must make during onboarding.
Staff need to inspect, save, or share labels
PDF is convenient for workflows that include human review. Staff can open the label, inspect the address, or attach the document to an internal support case using familiar tools.
A preview does not prove that the printed barcode will scan. It does, however, make basic document inspection easier than opening printer commands in a text editor.
The shipping provider only supplies PDF
Use the source format you actually have unless there is a clear reason to transform it. Converting a carrier PDF into ZPL is not the same as recovering a native, editable barcode layout.
A conversion process may rasterize the PDF and wrap the image in printer commands. That can introduce another resolution decision without providing the main benefits of native ZPL barcode commands.
For most teams, printing the original PDF with correct dimensions is a better first step than adding a conversion service.
Print quality: DPI and scaling matter more than the extension
ZPL layouts must match the intended resolution
Many ZPL positions and dimensions are expressed in dots. A four-inch-wide label corresponds to approximately 812 dots at 203 DPI and 1,200 dots at 300 DPI.
A layout built around one resolution will not necessarily retain its physical dimensions on another. Text, barcode widths, and field positions can change size or move relative to the label edges.
When requesting labels from a source that offers resolution-specific ZPL, select the output that matches the printer. If you generate the layout yourself, account for resolution throughout the design—not just in the overall label width.
PDF labels need the correct physical page size
For a 4 × 6-inch label, the ideal starting point is a PDF with a 4 × 6-inch page. A shipping label placed inside a letter-size PDF is a different document and may require an explicit layout or cropping step.
Then check:
- The printer has the correct media loaded.
- The selected paper size matches the PDF page.
- Automatic scaling is not unexpectedly shrinking the label.
- Rotation matches the media orientation.
- The barcode and its quiet zones remain unobstructed.
A vector barcode in a PDF can print sharply. Conversely, a low-resolution barcode image embedded in a PDF cannot gain missing detail simply because it is printed on a higher-resolution device.
If PDF output is clipped or reduced, use the dedicated 4 × 6 PDF shipping-label troubleshooting guide.
Validate the physical result
Test with the scanner, media, and printer settings used on the warehouse floor. Check labels from each supported printer model and resolution, especially after changing templates, drivers, or label sources.
A successful API request confirms submission, not barcode readability or carrier acceptance. For production carrier labels, follow the applicable carrier’s requirements rather than treating a local test scan as the only validation.
How to print ZPL and PDF with PrintScaler
PrintScaler accepts both PDF documents and RAW printer data through one HTTPS endpoint. That lets you keep a common delivery workflow while choosing the content format per printer or workstation.
The important distinction is the request’s contentType:
pdf_uri: Print a PDF available at a URL.pdf_base64: Print PDF bytes included as base64.raw_uri: Send RAW printer data available at a URL.raw_base64: Send RAW printer bytes included as base64.
RAW delivery does not translate ZPL into another printer language. The destination must understand the submitted commands.
Step 1: Connect and test the printer
Install the PrintScaler agent on a Windows, macOS, Linux, or Raspberry Pi computer that can access the printer. Link the computer by entering its pairing code in the dashboard.
The agent runs in the background and connects outbound, so this setup does not require opening inbound firewall ports. Use the dashboard’s test-page button to verify basic connectivity.
For a ZPL workflow, also send a known-good ZPL test appropriate for that printer. A successful general test page does not establish that RAW ZPL is supported.
Step 2: Record the printer and its format requirements
Find the printer ID in the dashboard or through the API. In your own application, associate that ID with the workstation and its configuration.
Useful application fields include:
- Destination printer ID.
- Selected label format.
- Printer language and resolution.
- Label dimensions.
- Warehouse or packing-station identifier.
These are configuration values your application maintains, not extra fields to add to the print-job request. PrintScaler exposes printer capabilities through its API; use those where relevant, and verify language support against the printer’s documentation and physical tests.
Step 3: Submit a PDF label
This example sends a PDF URL to a printer. Replace the URL with a real PDF that PrintScaler can retrieve, and replace the printer ID with your destination.
export PRINTSCALER_API_KEY='psk_replace_me'
curl --request POST \
'https://api.printscaler.com/v1/printjobs' \
--header "Authorization: Bearer $PRINTSCALER_API_KEY" \
--header 'Content-Type: application/json' \
--header 'X-Idempotency-Key: shipment-8472-label-original' \
--data '{
"printerId": 123,
"contentType": "pdf_uri",
"content": "https://files.example.com/shipment-8472.pdf",
"title": "Shipment 8472 shipping label"
}'
A browser-only URL that depends on a user’s session is not a suitable retrieval URL. For private documents, base64 submission avoids creating a document-download URL.
PrintScaler supports PDF options including paper size, rotation, and fit to page. Consult the print-job and options reference for the request structure and supported capability values rather than assuming every printer exposes identical settings.
Step 4: Submit the original ZPL bytes
The following Python example reads a ZPL file and submits it as RAW base64. It uses only the Python standard library.
import base64
import json
import os
from pathlib import Path
from urllib.request import Request, urlopen
label_bytes = Path("shipping-label.zpl").read_bytes()
payload = {
"printerId": 123,
"contentType": "raw_base64",
"content": base64.b64encode(label_bytes).decode("ascii"),
"title": "Shipment 8473 shipping label",
}
request = Request(
"https://api.printscaler.com/v1/printjobs",
data=json.dumps(payload).encode("utf-8"),
headers={
"Authorization": "Bearer " + os.environ["PRINTSCALER_API_KEY"],
"Content-Type": "application/json",
"X-Idempotency-Key": "shipment-8473-label-original",
},
method="POST",
)
with urlopen(request, timeout=30) as response:
print(response.status)
print(response.read().decode("utf-8"))
Read the file as bytes, as shown, rather than applying unnecessary text transformations. If the source supplies base64 already, establish whether it needs decoding first; accidentally encoding base64 text again changes the print data.
Run API requests on your backend or another trusted runtime. Do not expose the API key in browser-delivered code.
Step 5: Track delivery and make retries safe
Persist the relationship between your shipment, intended label, and submitted print job. Use PrintScaler’s job history or webhooks to observe state changes instead of treating an accepted HTTP request as physical completion.
Jobs can queue while the connected computer is offline and print when it reconnects, subject to the configured expiration time. Choose an expiration appropriate for shipping operations so an old label does not unexpectedly appear during a later shift.
Reuse the same X-Idempotency-Key when retrying the same intended submission after a timeout. A deliberate operator-requested reprint should be a separate action with a new key and an audit reason in your application.
Choosing a format for a mixed warehouse
You do not have to standardize every printer on the same label format. Instead, make format selection explicit before requesting or generating the label.
For example:
- A compatible 203-DPI thermal station receives matching ZPL.
- A 300-DPI thermal station receives output prepared for that resolution.
- A workstation using an office printer receives PDF with an appropriate page layout.
- A supervisor reviewing a shipment opens a PDF preview, if the label source provides one.
Keep these paths tied to the same shipment record, but do not submit both printable versions automatically. Otherwise, a fallback mechanism can create two physical labels for one intended print.
Avoid implementing automatic PDF fallback merely because a ZPL submission times out. The first request may already have been accepted. Resolve submission uncertainty through job tracking and idempotent retries before choosing another delivery path.
PrintScaler pricing is per print request, not per page. When estimating costs, count expected submissions, including intentional reprints, and check the current plans and included print volumes.
Quick troubleshooting checklist
| Symptom | What to check first |
|---|---|
| Printer outputs ZPL commands as text | Confirm ZPL support, active language mode, and RAW submission |
| ZPL label is too small or misplaced | Compare the layout’s target DPI with the physical printer |
| PDF label is reduced or clipped | Check page dimensions, selected paper size, scaling, and rotation |
| Barcode looks fuzzy | Inspect source image quality, scaling, darkness, speed, and printhead condition |
| API request succeeds but nothing prints immediately | Check job state, agent connectivity, printer status, and local errors |
| Two labels appear after a network timeout | Review retry logic and whether the same idempotency key was reused |
Change one variable at a time and keep a known-good label for each supported station. That makes it easier to distinguish a bad source file from a printer configuration or delivery problem.
Choose the simplest reliable label path
ZPL is an excellent fit for compatible, standardized thermal-printer fleets. PDF is often the better choice for mixed hardware, familiar previews, and label sources that already produce correctly sized documents.
Start with the original label format, validate it on the actual printer, and keep delivery separate from document generation. Create a free PrintScaler account to test PDF and RAW printing through the same API before committing your warehouse workflow.
Frequently asked questions
Is ZPL better than PDF for shipping labels?
ZPL is often a better fit for a standardized fleet of compatible thermal printers, especially when the label source provides resolution-matched ZPL. PDF is generally more flexible across different printer types and easier to preview. Correct dimensions, resolution, and printer settings matter with either format.
Can a Zebra printer print PDF shipping labels?
Many Zebra printer setups can print PDFs through an appropriate driver and PDF rendering workflow. That does not mean every model accepts a PDF file directly as RAW data. Verify the model's capabilities and use a PDF printing path unless direct PDF support is explicitly available.
Can I send ZPL to any thermal printer?
No. The printer must support the ZPL commands you send, either natively or through a compatible implementation. Check the exact model, language mode, resolution, and command support before using RAW ZPL.
Does converting a PDF label to ZPL improve barcode quality?
Not automatically. A conversion may simply rasterize the PDF and place the resulting image inside ZPL commands, which cannot restore missing source detail. First try printing the original PDF at the correct physical size without unintended scaling.
Can the same API print both PDF and ZPL labels?
Yes. PrintScaler accepts PDF using pdf_uri or pdf_base64 and RAW printer data using raw_uri or raw_base64. For ZPL, the destination printer must understand the commands; RAW delivery does not convert printer languages.
Why does a ZPL label print at the wrong size?
A common cause is a mismatch between the layout's intended DPI and the printer's actual resolution, since many ZPL dimensions are expressed in dots. Also check label width, length, media calibration, and printer configuration.