How to print ZPL from a .txt file
Marketplaces and shipping platforms often deliver labels as ZPL code in a .txt file. Choose the option that fits your printer. To check the label before you print, paste the code into the ZPL viewer.
Convert to PDF and print
Section titled “Convert to PDF and print”This option works with any printer. Follow these steps:
- Open the
.txtfile in a text editor and copy all of the text. The code starts with^XA. - Paste the code into the free ZPL to PDF converter and download the PDF.
- Print the PDF at 100% scale (Actual size). A smaller scale can make barcodes too small to scan. Use 4×6 in label stock on a thermal printer, or trim the label on a regular printer.
Send raw ZPL to a network printer
Section titled “Send raw ZPL to a network printer”Most ZPL thermal printers accept raw print jobs on TCP port 9100. Follow these steps:
-
Find your printer’s IP address. Most printers can print it from the feed-button menu.
-
Run the command for your operating system, with
PRINTER_IPreplaced by the printer’s IP address.On macOS or Linux:
Terminal window cat label.txt | nc PRINTER_IP 9100On Windows, in PowerShell:
Terminal window Get-Content label.txt -Raw | ForEach-Object {$client = New-Object Net.Sockets.TcpClient("PRINTER_IP", 9100)$writer = New-Object IO.StreamWriter($client.GetStream())$writer.Write($_); $writer.Flush(); $writer.Close(); $client.Close()}
Print through the Generic / Text Only driver on Windows
Section titled “Print through the Generic / Text Only driver on Windows”If your thermal printer connects to Windows by USB, install it with the built-in Generic / Text Only driver and print the .txt file to it. The driver passes the ZPL to the printer unchanged. For setup steps, see Install a Windows printer for RAW label printing.