Hex bitmap image gets split

K Kory Anderson 3 years 5 months ago
123 0 0

Problem: The images are getting flipped and split when printing
I am brand new to ZPL development. My solution to being able to print dynamic images on a zebra printer is using ^GFA. I understand that it's not officially supported but it's the only solution I could find that worked for my orgranization. If someone has a better way to handle what we need I'd be interested to know.
Context:
I need to be able to download an image from a partner software and print it on a zebra label with the rest of our label information, it can be any size/resolution, and it is a new image every time we process the label.
We exclusively use ZPL for printing, not using any drivers, building our own ZPL label and sending it directly to a network zebra printer using CUPS, (Linux default print service).
Things of note:
generally using gx420dn printers
The image is given to us as a png file.
I convert it using the linux imagemagick utility 'convert' to create a bmp file.
I convert the binary bmp to hex using the xxd command.
the bmp looks correct.
converting the hex back to binary using an outside program, the image displays correctly.
When I send the image to the printer using ^GFA the image is always vertically mirrored
mirroring I can deal with when I convert from png to bmp by using a flip flag, I'm not worried about that part
Unless I use specific widths of image, they get split into 2 pieces of varying sizes and the left is printed on the right, and the right on the left as shown below.
If my image widths are 1" 2.8" it works fine.

Any help as to why this is happening, or what I am doing wrong would be much appreciated. Zebra tech support couldn't figure it out, and directed me here.
Thanks.

CONTACT
Can’t find what you’re looking for?