online php libraries to convert image to zpl

1,620 views
Skip to first unread message

bhargav venkatesh

unread,
Sep 30, 2018, 6:25:45 AM9/30/18
to qz-print
Hi,
we are developing a desktop based application where we click the image of a particular person and print it on the Zebra GC420t. When we try to print the image it does not show up any image on the label. I tried in this launcher http://labelary.com/viewer.html when I load the image to this it shows the ZPL code with HEX values. 
 Is there any online API that converts the image to ZPL code
If available please share the link

Tres Finocchiaro

unread,
Sep 30, 2018, 7:18:00 AM9/30/18
to bhargav venkatesh, qz-print
The site you linked... Labelary is THE online service that does what you describe.

For pure PHP, our code can be ported to PHP if interested:


It spans a few files so grabbing the relevant code using IntelliJ Community will ease the process. (https://github.com/qzind/tray/wiki/compiling#intellij)

Note, we don't do any black+white dithering at this time, the source image needs to be in pure black+white at the time of writing.  If not, it does a basic lumen calculation to pick white or black.



--
You received this message because you are subscribed to the Google Groups "qz-print" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qz-print+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

bhargav venkatesh

unread,
Oct 1, 2018, 2:05:45 AM10/1/18
to qz-print
Can expand the steps you shared using IntelliJ and got some exceptions after running the PrintSocketServer code 
I am new to this software
I have followed every step shared and in the end, I am couldn't complete the steps 
Can you please expand the steps for further
As you have said that its an online service I am going to elaborate on the question I have asked yesterday

I am printing an image through Zebra GC420t printer. I used the API such as "BrowserPrint-1.0.4.min.js" which takes the input of the image and print it.
I am sending the parameters to the printer 

selected_printer.send("^XA^FX ^CFA,30 ^FO50,50^FDVisitor Name:"+$("#user").val()+"^FS ^FO50,80^FDCompany:"+$("#compName").val()+"^FS  ^FO50,110^FDTo Meet:"+$("#toMeet").val()+"^FS ^FO50,150^FDPurpose:"+$("#reason").val()+"^FS ^FO50,190^FDAuthorise^FS ^FO50,220^FDto Carry:"+mob+" "+lap+"^FS ^FO500,70^XG R:SAMPLE.GRF,1,1^FS^XZ"); 

I am able to print the text form but the image does not show up on the label. The link I have shared  http://labelary.com/viewer.html when I load the particular image it converts into the ZPL code that is hex code. Using that code when I hard code into the above statement I can print the image through my code.

I need an online API which converts the image to hex code and can be printed through my printer

Could you help me in getting this

Thanks in advance

Tres Finocchiaro

unread,
Oct 1, 2018, 11:33:20 AM10/1/18
to bhargav venkatesh, qz-print
BrowserPrint isn't us.  You want PHP code to automatically print ZPL? You're in the wrong place.

I liked your code so you can port it to PHP.  We offer no more assistance here.  The code was offered as a courtesy.

Tres Finocchiaro

unread,
Oct 1, 2018, 11:34:10 AM10/1/18
to bhargav venkatesh, qz-print
I *linked you our code so you can port it to PHP.  We offer no more assistance here.  The code was offered as a courtesy.
Reply all
Reply to author
Forward
0 new messages