Ratheendrans
1st August 2011, 15:24
Dear All,
I want to print the form image on to thermal printer interfaced to its serial port.
I am able to save the image on to a file.
QPixmap pixmap(this->size());
this->render(&pixmap);
pixmap.save("myfile.pgm", "PGM");
The thermal printer interfaced is capable to print the image with the following command from serial port.
ESC # print Logo.
ESC # nW nH Data String
i.e in hex format
<1Bh> <23h> <n1h> <n2h> <Hex String>
[Description]
Prints Logo/Image in the predefined area
Spacing: n x 0.125mm (1 dot size)
[nW x nH]: Print Area Size (Width x Height) (this will also equal to total number of bytes.
nW = Number of Bytes to be Printer per line
Max: 48 bytes
nH = Total Bytes / Number of Bytes Per line
Max: 255 bytes
can any one let me know the image format which I can use so that I execute the print command directly.
Or I have use a library to convert the standard file format to a Hex data.
Thanks in Advance.
ratheendran
I want to print the form image on to thermal printer interfaced to its serial port.
I am able to save the image on to a file.
QPixmap pixmap(this->size());
this->render(&pixmap);
pixmap.save("myfile.pgm", "PGM");
The thermal printer interfaced is capable to print the image with the following command from serial port.
ESC # print Logo.
ESC # nW nH Data String
i.e in hex format
<1Bh> <23h> <n1h> <n2h> <Hex String>
[Description]
Prints Logo/Image in the predefined area
Spacing: n x 0.125mm (1 dot size)
[nW x nH]: Print Area Size (Width x Height) (this will also equal to total number of bytes.
nW = Number of Bytes to be Printer per line
Max: 48 bytes
nH = Total Bytes / Number of Bytes Per line
Max: 255 bytes
can any one let me know the image format which I can use so that I execute the print command directly.
Or I have use a library to convert the standard file format to a Hex data.
Thanks in Advance.
ratheendran