macOS: Trying to add a Zebra printer via lpadmin

0

To automate things I usually install printers by way of lpadmin with a short one-liner similar to

sudo /usr/sbin/lpadmin -o printer-is-shared=false -o KMSection=true -p bizhub_C224e -E -v lpd://10.8.4.230/ -P /Library/Printers/PPDs/Contents/Resources/KONICAMINOLTAC224e.gz -D "Bizhub C224e" -L Squamish

Doing it this way works really well in my environments however one of my users just got a Zebra label printer which requires a socket connection. In addition the printer driver is built-in to CUPS, well on the Mac it is anyways. I cannot figure out how to state in the command that I want to use a specific Zebra ZPL printer driver on a socket connection.

Anyone else had any experience with this?

J

syntaxcollector

Posted 2019-07-29T22:19:33.860

Reputation: 121

Answers

0

You need to specify the printer-port in a different way:
For USB printers it is usb://Zebra/Model or something to that effect.
Use lpinfo -v |grep usb: to get a list of available USB ports. (You can ignore a ?location=XXXXX part if that is shown in the lpinfo output.)

For socket connections use socket://<ip-addres>:<portnumber>. E.g. for a JetDirect printers (port 9100) on ip-addres 192.168.1.2 you can use socket://192.168.1.2:9100.
Obviously using the DNS name instead of the ip-address will work too.

As for the model itself.
Check the CUPS web-interface first to see which models are available. Setup the correct one first as a dummy (via the web-interface) and then us lpinfo to see how it is shown in there. That name you can then use for subsequent adding via the command line. Or use lpinfo -m | grep Zebra to get a list of all available models.
There are only a few variants as all the Zebra models with a given printer-language (EPL, ZPL, EPL2, etc) use the same command-set. The density, DPI, label dimensions and other job-settings are simply set with commands in each print-job.

Tonny

Posted 2019-07-29T22:19:33.860

Reputation: 19 919