Using Zebra Printers under OS X
or: Thank God for Unix
You would think that a major printer manufacturer would bother making drivers for the second most prevalent desktop operating system. If you did, you’d be wrong. Zebra printers don’t have any OS X support at all—but that’s no reason to despair.
I find myself in a situation where I want to print to a Zebra printer under Mac OS X—specifically, an LP2844—for high-volume printing of FedEx shipping labels. Don’t tell me “businesses run on Windows™”, “just buy a Dell!”, or any of that. Yes, it’s true that most shipping software runs exclusively on Windows. (It’s also true that most shipping software sucks.) The point is, the business in question already runs on Macs, and I’m not about to change that.
Sure, I’m swimming upstream, but I’m just that kind of guy.
Here’s what I knew before I got a printer to play with:
- FedEx has a SOAP API. Among other things, this lets me create shipments and get labels returned as PDFs or ZPL (the native language of Zebra printers) regardless of platform.
- There are rumors on the CUPS mailing list of people that have gotten Zebra printers to work under OS X.
- Endicia for Mac (USPS shipping software) supports the LP 2844 over USB, which means there’s some way to talk to this printer using USB from user space.
- NRG Software makes an application that can monitor a directory and send files to a label printer, but I’d rather not pay $150/seat unless I have to.
- There are plenty of print servers that talk LPD on one end and parallel on the other, so worst-case, I can throw ZPL at this printer over the network, even without OS X’s cooperation.
Ideally, I’d be able to talk to this printer over USB in such a way that Endicia still works too. After all, you never know when you’ll want to USPS something.
Upon receipt of a printer and a roll of labels, I plugged it in, and found that Mac OS X sees a printer. One hurdle down. Print using… wait, there’s no Zebra option. Well, that figures, since Zebra doesn’t make OS X drivers.
Ah, look. Easy Software Products (ESP) has a Zebra ZPL Label Printer driver. Neat. Printer added.
Okay, try to print… nothing. Not from OS X, not from lpr, not even lpr -l, which skips the printer-specific driver and passes the bits straight to the printer. Dang.
Anyway, I try some other things, including hooking it up to a print server, and get nothing. “How is this possible?”, I think to myself. Then it hits me: wait a minute, the LP 2844 doesn’t support ZPL. It talks EPL.
I get an EPL file to try, zing!, prints out great. Plug it over USB, zing!, works fine. After some fiddling with /usr/libexec/cups/backend/usb, I’ve got an XML-RPC service that runs on my Mac, returns a list of directly-attached USB printers (including serial numbers), and can send preformatted data (e.g. EPL or ZPL) to any of them over the network. It plays nice with Endicia, plays nice with multiple printers, requires no client-side configuration—you don’t even need to add the printer—and didn’t cost me a cent.
Good times.
Technical Bits
Here’s the gist of how I’m using the CUPS USB backend:
$ /usr/libexec/cups/backend/usb direct usb "Unknown" "USB Printer (usb)" direct usb://Zebra%20/LP2844%20?serial=_____ "Zebra LP2844 " "LP2844 "
That enumerates attached printers, and gives you a URL that the USB backend can use to find the printer again. To send a print job, you say:
$ DEVICE_URI="usb://Zebra%20/LP2844%20?serial=_____" /usr/libexec/cups/backend/usb 0 nil nil 1 -
It takes EPL (or whatever) on standard input. I don’t really know what the arguments are for; a cursory examination of the source indicated they weren’t interesting to me for my application, it might be different for yours. Also, I looked only at usb-darwin.c, which is assuredly different than the usb.c for other platforms.
Given this, it’s a hop, skip, and a jump to making this network-capable, scripted, or whatever. If anyone is interested, I’d be happy to sell you my code (or build something special); email me at zebraprinting@<this domain>.com.
Comments
Trackback URL:
I went through the same process with Linux. The LP2844 now works using CUPS drivers, but I am still having trouble with PayPal’s JRE label printing (java works fine, label displays on screen, but the printer flashes once and refuses to print). Perhaps I should try Endicia, but with PayPal payments coming in, the integration is a nice feature.
I am thinking of setting up an old iMac in my shipping area and want to try the LP2844 with it.
What ‘fiddling’ did you need to do with CUPS USB ?
Rod
I added the Technical Bits section above to address your question. Hope it helps
Hey guys, I’m running into the same problem with a Zebra /xiIII Plus 600 dpi printer. I loaded an emulator on osX with the new intel ship (chip) thinking that I could load the driver that way. NOT !!! Emulator is upgrading in a couple of months to recogniize the conectivity of the USB . In a nut shell you have to be able to load it on the mac to see it in the emulator. That was after spending 80 bucks on that software. Now I’m thinking of buying a driver from http://www.peninsula-group.com/driver/ which is about 250 big ones. If there’s a way you could help a sister out, I’d surely appreciate it.
THE HUMPHREY LINE kyart@humphreyline.com
check out our web site www.humphreyline.com
Hope to hear from ya soon!!!
Hey Will – In addition to the drop app, which works great for people using NetSuite or other web-based solutions that generate EPL files, we do offer full blown shipping solutions for UPS , FedEx and DHL label generation on OS X . http://www.nrgsoft.com/products/ Our solutions integrate well with most any backend system which allows our users to have fulfillment systems that rival software which costs tens of thousands of dollars.
Excellent article its realy helpful, keep up the good work! Thank you.
Hello,
Thanks for the article.
I’m trying to integrate DHL functionality into a custom FileMaker solution. I don’t know if DHL can generate labels in the EPL format, but I just contacted them, so we’ll see.
Anyway, do you have a sample EPL file you can email me? I can’t seem to locate one on the internet.
FYI , the following forum post hints that FedEx can generate labels in the EPL format: http://www.nabble.com/FedEx-and-Thermal-Labels-td13162327.html
Regards, Sean
Argh! I can’t find that EPL file anywhere . If you could email me a copy of it or tell me where to find it I’d be very appreciative!!! Thanks and great work on this!!
Erik extensivegroup (at) yahoo.com
I meant ESP file—the easy software products page now has nothing of any drivers.
Thanks Will!
Erik extensivegroup (at) yahoo.com
Hey Will,
I’ve tried looking for the EPS file, but can’t find it anywhere…would you be able to email it to me or point me in the right direction as well?
Thanks!
Jeff jeff.cooley@meadowcreekmusic.com
Hey Will,
I’ve tried looking for the EPS file, but can’t find it anywhere…would you be able to email it to me or point me in the right direction as well?
Thanks!
Jeff jeff.cooley@meadowcreekmusic.com
Hey, just wanted to mention that the latest 10.5.2 update has full support for eltron/zebra printers via CUPS . We’ve got a posting on our site now that shows how to add it.
http://www.nrgsoft.com/blog/?p=11
urls to the latest world news.
Thanx a lot, this is totally awesome, it works fine on 10.4. and 10.5. . You don’t even have to set the printer up in the control panel, just plug and dump the EPL .
The EPL is pretty simple, just look for a manual, and hack away: http://www.servopack.de/Files/HB/EPL2_Manual.pdf
e.g.
N B10 ,10,0,1,2,4,50,B,”12345678” P1
should guve you something to start with.
Hack away!
ouch, press return after each line like this:
N
B10 ,10,0,1,2,4,50,B,”12345678”
P1
Try NeedForNews.com, a new comprehensive news aggregator. With NeedForNews, you don ’t really have to go anywhere else. http://rssnewsdigest.com/top_search.php
We search Feeds For You http://feedogator.com/
I think you have reason enough not to even be bothered with a piece of equipment/software if its not even compatible with the major OS…but nice workaround.
Topic is very informative. Thanks.
very informative here..thanks
very informative here..thanks
Thank you Will, you really helped me out of some trouble!
Thank you Will, you really helped me out of some trouble!
so … how do I pipe stuff like EPL to a device attached by USB ? cat filename > /dev/usb ? or that like?
help!