How do I print ZPL Labels from the Command Line on Mac/Unix?
It's much easier to automate printing of ZPL labels from the command line than through any UI. On Mac/Unix, you can print in just two steps:
Find your ZPL printer's name in the list of attached printers:
$ lpstat -p -d
Use that printer's name and your ZPL's filename:
$ lpr -P <PRINTER_NAME> -o raw <FILENAME.zpl>
Some printers require additional options, such as page size and margins. To get your printer's specific options, use:
$ lpoptions -p PRINTER_NAME -l
The command might end up looking something like this depending on the options it lists:
$ lpr -P PRINTER_NAME -o media=Custom.4x6in -o page-left=0 -o page-right=0 -o page-top=0 -o page-bottom=0 FILENAME.png
How do I connect my label printer to your API?
Each Shipment object will have the
postage_label string that will contain a
label_url, which you can use to retrieve the label file. We have an in-depth printing guide available here.
We also have documentation around printing with Printnode as well.
Is there an easy way to automate printing shipping labels?
When you purchase postage at EasyPost, the Shipment will have a
postage_label object that contains a
label_url. You can use that code to automate the printing process after purchasing a label. You can find an in-depth example of how to do this here.