Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Print BMP with ZPL

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?

like image 266
Mark Brouch Avatar asked Aug 16 '11 18:08

Mark Brouch


People also ask

Can you print PNG to Zebra printer?

Printing a graphic from a PNG file is best done using the Zebra Driver, Zebra Setup Utility. or ZebraNet Bridge. If you cannot use these methods we are providing an example of how this can be done using ZPL. Specifically the ~DY command. The ~DY can be used to download a known file type (bmp, png, pcx).

What are ZPL commands?

Resolution / Answer. Zebra Programming Language (ZPL) is the command language used by all ZPL compatible printers. It is a command based language used by the printers as instructions to create the images printed on the labels.


1 Answers

Try this instead:

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

Good luck.

like image 86
B Gautreau Avatar answered Oct 11 '22 19:10

B Gautreau