beautypg.com

Datamax-O'Neil PrintPAD AN-04 (LP) User Manual

Page 3

background image









Now we are ready to print this image, which is 24 pixels wide and 10 pixels high. We’ll print it on an imaginary printer
whose printhead is only 24 dots wide (3 bytes). We can use pixel and dot interchangeably here, since each pixel in our
image is represented by one dot on the printhead. We would send the following to the printer which represents the ESC
V n1n2 command as well as the data for the image:

0x1B 0x56 0x00 0x0A 0x00 0x3C 0x00 0x00 0xFF 0x00 0x01 0x81 0x80 0x03 0x3C 0xC0 0x06 0x3C 0x60 0x0C 0x3C
0x30 0x06 0x3C 0x60 0x01 0x81 0x80 0x00 0xFF 0x00 0x00 0x3C 0x00

The 0x1B is the ESC character, the 0x56 is the ‘V’, the 0x00 is the MS Byte of our 16 bit count of 10 (since the image is
10 pixels high), and the 0x0A is the LS Byte of our 16 bit count of 10 (since 10 decimal is 0A in Hex). The rest of the
bytes are the data from the image, arranged left to right and top to bottom.

A common question that arises is “What do I do if my image is not as wide as the printhead?”. The answer is to pad
white space around the image so that it will print properly. To use our previous example using the rectangle in the
diamond, let us assume that we want to print this image in the center of another imaginary printhead that is 40 dots
wide. We would pad white space in front of and behind the image – 8 pixels in front and 8 pixels behind will give use 8
pixels + 24 pixels + 8 pixels or 40 pixels total:


0x00 0x00 0x3C 0x00 0x00
0x00 0x00 0xFF 0x00 0x00
0x00 0x01 0x81 0x80 0x00
0x00 0x03 0x3C 0xC0 0x00
0x00 0x06 0x3C 0x60 0x00
0x00 0x0C 0x3C 0x30 0x00
0x00 0x06 0x3C 0x60 0x00
0x00 0x01 0x81 0x80 0x00
0x00 0x00 0xFF 0x00 0x00
0x00 0x00 0x3C 0x00 0x00

In this case, the data that would be sent to the printer which represents the ESC V n1n2 command as well as

the data for the image is:

0x1B 0x56 0x00 0x0A 0x00 0x00 0x3C 0x00 0x00 0x00 0x00 0xFF 0x00 0x00 0x00 0x01 0x81 0x80 0x00 0x00 0x03
0x3C 0xC0 0x00 0x00 0x06 0x3C 0x60 0x00 0x00 0x0C 0x3C 0x30 0x00 0x00 0x06 0x3C 0x60 0x00 0x00 0x01 0x81
0x80 0x00 0x00 0x00 0xFF 0x00 0x00 0x00 0x00 0x3C 0x00 0x00

Again, the 0x1B is the ESC character, the 0x56 is the ‘V’. The dotline count does not change even though the width
and the number of image data bytes did change – it is still 10 as represented by the 0x00 and the 0x0A. All bytes after
this are the image data again, but this time there are more bytes.

A bitmap image as we are referring to it should not be confused with a .BMP file from Microsoft, since that file has a
header and is inverted. Any "standard" graphics image format file used on PCs and the Internet will need to be
converted to its pure, raw, bitmap form before sending down to be printed. Information about these “standard” graphics
file formats can be found on the web.

There are a few rules when printing graphics, if you follow these rules and form the data for your image according to the
examples above, you should have no trouble printing graphics on the printer:

1. The graphic MUST be the same width as the printer - 384 pixels for 2" thermal, 576 pixels for the 3" thermal,

832 pixels for the 4" thermal, and 240 pixels for the 2" impact. If it is not the same width, then you must pad
with white space (0x00 bytes) on each line.

This manual is related to the following products: