Print House

How to Print a ZPL File to a Label Printer

· 5 min read · Printing at Home

In this article
  1. Print a ZPL File in 7 Steps
  2. How to Tell It Worked
  3. The One Failure Everyone Hits: Blank Labels
  4. Ways to Send ZPL and When to Use Each
  5. Sending ZPL Over the Network
  6. Testing With a Known-Good ZPL Sample
  7. When the Printer Prints Garbage Instead of a Label
  8. Keeping ZPL Files Ready to Reprint

Send the ZPL file straight to the printer as raw text instead of opening it in an app. On Windows, the simplest route is a shared printer with a Generic/Text Only driver and the copy command; on a network printer you can send it to port 9100.

Time 10 min · Steps 7 · Level Easy

You will know it worked when the label comes out with the barcode, text and layout intact, in about the time it takes the printer to feed one label. The whole setup takes about 10 minutes the first time and seconds after that. ZPL files are plain text commands, so the trick is getting them to the printer unmodified, which is what the steps below do.

  1. Confirm the file is ZPL. Open the file in Notepad or any text editor. You should see commands starting with the caret character, such as ^XA at the top and ^XZ at the bottom. If you see binary garbage, it is not a ZPL file.
  2. Connect the printer. Plug the label printer in by USB, or make sure it is on the same network. Load labels and let the printer finish its calibration before printing.
  3. Install the printer in Windows. Open Settings > Bluetooth & devices > Printers & scanners and add the printer. When asked for a driver, choose Generic / Text Only rather than the manufacturer's driver, so Windows passes the file through untouched. Menu names can differ slightly by Windows version.
  4. Share the printer. Open the printer's properties, go to the Sharing tab, and give it a share name with no spaces, for example ZEBRA1.
  5. Send the file with the copy command. Open Command Prompt and run: copy /b yourfile.zpl \\your-pc-name\ZEBRA1. The /b flag sends the file as binary, which preserves it exactly.
  6. Watch the label print. The printer should feed one label and cut or present it within a few seconds. Do not open the file in Word or a PDF viewer first, since those programs will reformat it.
  7. Repeat for future files. Keep the share set up and reuse the same copy command, changing only the file name. You can also drag files onto a desktop shortcut that runs the command.

How to Tell It Worked

The label prints once, with the barcode scannable and the text where the file places it. A quick scan with a phone barcode app or a handheld scanner confirms the barcode carries the right data. If the printer's data light flashes and a clean label comes out, the file arrived intact; nothing else needs checking.

The One Failure Everyone Hits: Blank Labels

The printer feeds a label but it is blank, or it prints a sliver and stops. This almost always means the file was reformatted on the way through. The fix is to check two things: make sure the printer is using the Generic/Text Only driver, and make sure you used copy /b rather than plain copy, because plain copy can append an extra character the printer reads as a command. If the label prints but the content is shifted or cut off, the label size in the ZPL does not match the labels loaded, so the printer needs its media calibration routine run, usually done from the printer's own menu.

Ways to Send ZPL and When to Use Each

Pick the route that matches how the printer is connected. All of them deliver the file unmodified; they differ in setup effort and where you can use them.

MethodBest forSetup
copy /b to a shared printerUSB printer, WindowsOne-time share, then one command
Send to network port 9100Printer with an IP addressA small utility or browser tool that sends raw text to the IP
Manufacturer's setup utilityAny connection, when you also want test labelsInstall the utility, use its send-file option
Label design softwarePrinting many files or merging dataHeaviest setup, most control

Sending ZPL Over the Network

If the printer has an IP address, you can skip the sharing setup. Print a network configuration page from the printer's menu to find the IP, then use any raw-text sending tool pointed at that IP on port 9100, which is the standard raw-print port on network printers. Paste the ZPL or attach the file, send, and the label prints. This route works from any computer on the same network, including ones that never installed the printer.

Testing With a Known-Good ZPL Sample

Before blaming your file, send a short test label. A minimal ZPL file looks like this: a line with ^XA, a line with ^FO50,50^ADN,36,20^FDTEST LABEL^FS, and a line with ^XZ. Save those three lines as test.zpl and send it the same way. If TEST LABEL prints, your method works and any problem is in the original file; if it does not, the problem is the connection or driver, not the file.

When the Printer Prints Garbage Instead of a Label

A label full of stray characters means the printer received the file but interpreted it wrong, usually because the file was converted on the way, for example emailed as rich text or saved with extra formatting. Re-export or re-download the original .zpl file, open it in Notepad to confirm it still starts with ^XA, and send it again with copy /b. If the printer model does not support ZPL, it will print the commands as plain text; check the printer's specification page, since some printer families use a different command language and need a file in that language instead.

Keeping ZPL Files Ready to Reprint

Keep your .zpl files in one folder with names that say what is on the label, since the file name is the only thing you see before printing. Because ZPL files are plain text, they stay readable for years and open in any text editor, so there is no version problem. If you print the same label often, a desktop shortcut that runs the copy command with a fixed file name turns reprinting into a double-click.

Official source: Zebra Technologies