0
votes

I'm trying to print images on a Zebra printer using ZPL commands. This is the code:

^XA
^FO10,10^XGR:ICONE.GRF,3,3^FS
^XZ

My problem is that I can't print image from the Flash Memory. I only get image printed from DRAM memory. Could some one give me some tips?

3
Welcome to Stack Overflow. Can you please share some of the code that you have tried that hasn't worked? How did you expect it to work and how did it differ from how it actually worked? Please see: how to ask a good question.Lews Therin

3 Answers

3
votes

Your ZPL sample relies on the printer having been pre-configured correctly by uploading the image to the printer memory (at the printer memory path R:ICONE.GRF). This is a little more brittle than just embedding the image directly in the ZPL, as you have found out.

If you're always embedding the same image (which appears to be the case), and if you're not worried about shaving milliseconds off of your print latency (most people aren't), then I'd recommend embedding the image directly in your ZPL using the ^GF command.

There's a little bit of black magic involved in getting the ^GF command right, but it's pretty easy if you have ZebraDesigner installed or if you just use Labelary to add the image to your label ZPL template.

1
votes

Why don´t you create a memory bitmap loading the image from E: into it and printing from this memory image? You could do something like:

    Dim image1 As Bitmap = CType(Image.FromFile("E:\ImageFile.bmp", True), Bitmap)

You may also put a PictureBox in your form, load the image into it and call your Zebra code on that control - it´s in memory too.

0
votes

I just figured out my stupid error in the code:

^FO10,10^XGR:ICONE.GRF,3,3^FS

The solution was simply change de "R" by "E":

^FO10,10^XGE:ICONE.GRF,3,3^FS

Thanks for the ansswers.