Troubleshooting
The printer prints the ZPL code instead of the label
Pages of ^XA^FO50,50 instead of a label mean something between you and the printer is treating the ZPL as a document to typeset rather than as commands to obey.
What is actually happening
ZPL is a command language, not a document format. When a printer receives it and prints it as text, the printer never saw it as ZPL at all — something in the path rendered those characters into an image and sent the image to be printed.
That something is almost always a driver. A graphics driver's job is to turn what an application draws into dots; hand it a text file full of carets and it does exactly that, faithfully and uselessly.
The driver is the usual answer
Sending ZPL through a Windows printer driver that renders graphics gives you a picture of your code. Sending it through a driver that passes bytes through untouched gives you a label.
- 1Use a pass-through driver. On Windows the Generic / Text Only driver does nothing to the bytes, which is exactly what is wanted here.
- 2Or bypass the driver entirely. Most Zebra printers accept raw ZPL on TCP port 9100, and sending the file to that socket removes every layer that could reinterpret it.
- 3Or use the manufacturer's tools. Zebra's own utilities send raw files to a printer without a spooler in the path.
The same file printed two ways is the fastest diagnosis available. If it prints as a label over port 9100 and as text through the driver, the file is correct and the driver is the problem — no further ZPL debugging needed.
When it is not the driver
Two other causes produce the same symptom. The first is a printer in the wrong language: some models support more than one page-description language, and one set to EPL or line-print mode does not recognise ZPL commands as commands.
The second is a file that never starts a format. Commands before the first ^XA have nothing to attach to, and a file that lost its first line can look like ZPL and behave like text.
^SZ selects between the original ZPL and ZPL II, which is a related but different question: a printer in the wrong ZPL mode produces labels that are subtly wrong, not labels that are pages of source code.
Open the ZPL viewer
Paste the file and see whether it is a valid label before blaming the printer. If it renders here, the ZPL is fine and the path to the printer is what needs fixing.
Open the ZPL viewerCommon questions
- Which Windows driver should I use for ZPL?
- Generic / Text Only, which passes the bytes through without rendering them. A graphics driver turns your commands into a picture of your commands.
- What is port 9100?
- The standard raw printing port. Opening a socket to the printer on 9100 and writing the ZPL sends it with nothing in between to reinterpret it, which is both the most reliable way to print and the fastest way to rule the driver out.
- My file prints as text on one printer and as a label on another. Why?
- The two are reached through different paths — one through a rendering driver and one raw — or one of the printers is in a different language mode. The file is the same, so it is not the file.