ZPL file to image

goldjunge picture goldjunge · Nov 3, 2015 · Viewed 8k times · Source

I have UPS generated label with ZPL which I want to print. I can do it via printer driver but it is not convinient.

I could generate GIF file but after resizing to 4x8 inches it looses quality.

Is there a way to convert ZPL file into common graphic format so I can just open and print from a file ? Preferably in PHP.

Answer

Simon Kreuz picture Simon Kreuz · Nov 4, 2015

If it's just one / some labels, you can try to use http://labelary.com/, they convert ZPL online to image files.

UPS does offer GIF labels in different formats though, so it should be possible for you to request the right format and convert it without quality loss.

If you're looking for an easier way to deal with label filetypes, you may want to explore Shippo. Shippo offers a PHP client library and you can easily change label file types (PNG, ZPL, PDF) on a per-request basis via a RESTful API.