Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get labels in pdf using ups api?And how to print it directly on the web?(php)

I have get label of gif file successfully.how to get pdf format.I have read the guide about labelimageformat several times.It says:

"Label print method code that the Labels are to be generated for EPL2 formatted Labels use EPL, for SPL formatted Labels use SPL, for ZPL formatted Labels use ZPL and for image formats use GIF, for Star Printer format formatted Labels use STARPL.

For shipments without return service the valid value is GIF, ZPL, EPL and SPL. For shipments with PRL return service, the valid values are EPL, ZPL, SPL, STARPL and GIF."

like image 529
Wenhuang Lin Avatar asked Sep 15 '25 16:09

Wenhuang Lin


1 Answers

UPS does not return PDF labels. You have to convert the GIF that is returned into a PDF. You can do this easily using the 'convert' command of ImageMagick or using GhostScript.

Here is an example of 'convert':

convert  -bordercolor none -border 100x100  -page Letter ups.gif ups.pdf
like image 51
Nilesh Avatar answered Sep 18 '25 05:09

Nilesh