Thermal Printing UPS and FedEx Labels from the Web Browser

Many ecommerce web site owners use UPS and FedEx and need to print labels. I would guess a majority of these site owners print their labels through software like UPS WorldShip or FedEx Ship Manager.   Others may use the UPS or FedEx web sites to create shipments and labels.   But, what if you want more advanced integration options?

We have integrated FedEx and UPS for many clients using the FedEx and UPS Web Service API’s which can be found at the following URL’s:

Both of these services allow you to pull down labels when creating shipments.   FedEx has labels in PNG format while UPS uses GIF.   You can print these to a laser printer or inkjet printer without an issue.   In fact, it is recommended.   But, what happens when you try to print the labels to a Zebra thermal printer?

Well, we have had success printing the FedEx labels directly to the Zebra printer driver.   The driver is able to print the image without much issue.   Recently we needed to do something similar for UPS.   We did not have very good luck when printing the UPS GIF image.   The GIF that is returned does not print very clearly and is not crisp.  It does look OK when printing to an inkjet printer, but not the thermal printer.   To be fair to the Zebra, the original GIF is not all that great when it comes to image quality.

We had the new challenge of trying to find an alternative way to print the UPS label directly from a web browser like we were with raster images.   The solution we chose was to integrate the open source plugin called jZebra.

We changed the code to ask UPS for ZPL labels and stored the base64 string in the database.   We could then use the jZebra print64 method to print the commands directly to the Zebra Thermal Printer from the browser window.   The quality was the same as using WorldShip.   Many thanks to the people working on the Java jZebra plugin!

This entry was posted in Programming. Bookmark the permalink.

Leave a Reply