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?
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).
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.
Try this instead:
^FO0,0^IMG:PRINT.BMP^FS
Good luck.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With