20150902

Getting A Zebra Printer Working On Linux (And OSX?)

Since I got a thermal shipping label printer and have been getting shipping labels from Shippo, I figured out how to print from ZPL (Zebra's printer language). I found that printing from ZPL was more reliable than printing from a PDF since PDF prints are fraught with dithering and aliasing issues. To print, I simply drag and drop the file(s) I want to print on a printer launcher. You cannot get much simpler. Here is how I did it:

For Reference, I am using Linux Mint 17.1. This same idea should work for other Ubuntu derivatives as well as OSX (I have not tested anything on OSX).

First, plug in your printer via USB and power it on. Open up your printer settings (windows key > type "printers" > press Enter). Click on "+ Add" to add a new printer.

 

The Zebra printer should appear on a USB port. Select it and click "Forward."


For the driver, select "Generic (recommended)" and click "Forward."


Next, choose "Raw Queue" and click "Forward."


Give the printer a meaningful name. Here I call it "ZPL_II_Printer." The name should have no spaces. Remember the name because we will need it later. Click "Apply."


You should now have a new Raw Queue printer.


Head over to your Desktop and right click. Select "Create a new launcher here..."


Give the printer launcher a meaningful name like "Print ZPL II." You can also put something in the comment field if you want. You can change the icon by clicking the current icon to bring up a file browser. Select your new icon there. Here I chose a Zebra logo. In the command field, type:

lp -d ZPL_II_Printer %f


To break this command down, "lp" is the CUPS print command, "-d" is the option to specify a printer, "ZPL_II_Printer" is the name of the printer we created earlier, and %f is a file placeholder for whatever file or files we drag and drop onto the launcher. If you select multiple files to drag and drop, they just print out in sequence. Select "Close" and you should be good to go. Start dragging and dropping ZPL files onto the launcher and watch them print!

From what I understand, you could get this same functionality in OSX using the "Automator."

There is no special magic going on here. A ZPL file a simple text file with printer machine commands. Since we set up the printer as Raw, it is just sending raw commands over a USB virtual COM port. No proprietary software or drivers are necessary to communicate with the printer.

Hopefully this helps!

P.S. If you are having trouble reliably printing scan'able barcodes on First Class International labels check out my post on automatically resizing the barcode and printing.