5
votes

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?

5
Hope you don't mind my necroposting here -- I ran into a similar problem recently, and here is a PHP script I created for converting other image formats to ZPL graphics (BMP is not supported since GD2 is used, but it works with other formats such as PNG or GIF): github.com/pbosakov/image2zplPetko Bossakov

5 Answers

2
votes

Try this instead:

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

Good luck.

1
votes

After my information you canNOT use .BMP extension, thus it is set to a fixed value, which is .GRF

Check this as well -> http://www.servopack.de/support/zebra/ZPLII-Prog.pdf

1
votes

Here is the link to download the Zebra Setup Utilities:

https://www.zebra.com/us/en/support-downloads/eula.-227178c9720c025483893483886ea54dde80fe8dccd74087deac0002665121f1b906a97e0267e4c60078aef6cd4a559.html

Once I launched the app I pressed the "Install New Printer" button and installed a random printer.

After installing the printer, select the printer and press the "Download Fonts and Graphics" button. This will install the "ZebraDesigner Fonts and Graphics Downloader".

You can use this utility to convert bitmaps to zebra bitmaps.

I am following these directions now. I'll let you know if it works.

https://km.zebra.com/kb/index?page=content&id=SO7892

The software works, but I still can't convert a .bmp to an actual ZPL bitmap.

0
votes

This site provides a ZPL viewer that includes the ability to import an image. When imported, the image is converted to ZPL and the resulting code is provided.

http://labelary.com/viewer.html

Obviously this will only work for static images.