Print BMP with ZPL

Mark Brouch picture Mark Brouch · Aug 16, 2011 · Viewed 26k times · Source

How can I use ZPL II to print a bitmap (BMP) image?

I used ~DY to download the BMP to the printer:

~DYR:PRINT,B,B, <size> , <width> , <data>

I am using PHP to send raw data to the printer, so <> variables are coming from that script. Using the printer's diagnostic utility I verified that the file was successfully downloaded using that command. I was also able to print that BMP file using TSPL, a different printer language that this particular printer also supports in addtion to ZPL, so I know that the BMP was written correctly.

I tried using the following code to then print the BMP:

^XA
^FO0,0^XGR:PRINT.BMP,1,1^FS
^XZ

But it only spits out a blank label.

What am I doing wrong?

Answer

B Gautreau picture B Gautreau · Nov 28, 2012

Try this instead:

^FO0,0^IMG:PRINT.BMP^FS

Good luck.