Printing a bitmap to a Zebra printer.

The aim was to print a bitmap for the post office PPI (Printed Postage Impressions) on the same label as the address.

 

 

The biggest problem was converting the bitmap data to the hex format for the zebra. The zebra data is simple black/white on/off bundled in hex.

~DGR:SAMPLE.GRF,7688,31,
00000000000000000000000000000000000000000000000000000000000000
7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
700000000000000000000000000003ffffffffffffffffffffffffffffffff
700000000000000000000000000003ffffffffffffffffffffffffffffffff
700000000000000000000000000003ffffffffffffffffffffffffffffffff
700000000000000000000000000003ffffffffffffffffffffffffffffffff
700000000000000000000000000003ffffffffffffffffffffffffffffffff
700000000000000000000000000003ffffffffffffffffffffffffffffffff

......

7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
 

After looking at the bitmap format and trying to convert to simple binary without success an easier method was needed. By displaying the bitmap on a dialog and using GetPixel() to scan through line by line, creating a hex dump was much more straightforward. Inevitably it printed upside down and mirrored at first but a nice printout was achieved. All we then had to do was change the size of the bitmap to suit, rescan until correct. Having this file done we merge the text file with the address label data.