How to Print Png image using Javascript and PHP

M MANJUNATH GODACHAPPANAVAR 3 years 7 months ago
203 1 0

We are Developing application where we required to print Image through Zebra Printer. The application uses Zebra Js Files from which we are able to print text. But we are facing problem in printing Image.

I'm converting .png image to .grf using php (Ref image2grf)
Sending Parameter using following lineselected_printer.send("^XA^FX Second section with recipient address and permit information. ^CFA,30 ^FO50,30^FD"+$("#user").val()+"^FS ^FO50,70^FD"+$("#compName").val()+"^FS ^FO50,110^"+$("#mob").val()+"^FS ^FO50,150^FD"+$("#email").val()+"^FS ^FO50,190^FDTo Meet:"+$("#toMeet").val()+"^FS ^FO50,230^FDPurpose:"+$("#reason").val()+"^FS ^FO50,260^FDAuthorise to Carry e-Device:"+mob+" "+lap+" "+other+"^FS ^FO50,220^FDAuthorise to Carry e-Device:"+mob+" "+lap+" "+other+"**^FO20,20^XGR:SAMPLE.GRF,1,1**^FS^XZ");

Please provide the Solution

Please Register or Login to post a reply

1 Replies

Y Yanis Dalabiras

Hi
Working with images in Zebra printers is usually a 2 step process.  First you have to send the image to the printer to store it, then you use it in a print job.  The output from the image2grf function will store the image.
Forgive me if the PHP is wrong, it's not a language I use.
$outputOfimage2grf = image2grf($filename, 'R:SAMPLE.GRF');
selected_printer.send($outputOfimage2grf);
selected_printer.send("^XA^FX Second section with recipient address and permit information. ^CFA,30 ^FO50,30^FD"+$("#user").val()+"^FS ^FO50,70^FD"+$("#compName").val()+"^FS ^FO50,110^"+$("#mob").val()+"^FS ^FO50,150^FD"+$("#email").val()+"^FS ^FO50,190^FDTo Meet:"+$("#toMeet").val()+"^FS ^FO50,230^FDPurpose:"+$("#reason").val()+"^FS ^FO50,260^FDAuthorise to Carry e-Device:"+mob+" "+lap+" "+other+"^FS ^FO50,220^FDAuthorise to Carry e-Device:"+mob+" "+lap+" "+other+"**^FO20,20^XGR:SAMPLE.GRF,1,1^FS^XZ");

CONTACT
Can’t find what you’re looking for?