views:

117

answers:

2

Hey all. I am troubleshooting a thermal printer issue when printing over bluetooth. The printer in question is Extech 3750T and the software is running on Windows CE. The driver is implemented on top of Winsock and is written in C++. As far as I can tell the connection housekeeping is all according to spec.

The issue seems to be that sometimes (about once out of ten) when an image is printed the printer just stops. Then, when the next print job is sent it would output a single line (one pixel wide) of garbage and print the new page.

The driver is built on top of RTF and it translates RTF commands and graphics into printer specific characters and escape sequences. The developers manual is available from here:

http://www.adtech.com.pl/upload/3750T%5FDevelopers%5FManual.pdf

At this stage I am fairly convinced that it is not a flow control issue (other than changing the buffer sizes might somehow help).

One thing that is confirmed is that whenever the printer screws up it sends an out of paper control character to the device, but by that time it's already too late to salvage it.

Also, I think the problem is caused by sending an image while text is still printing. A dirty hack of just wawiting like 5 seconds seems to make it go away, but it's way to awkward to implement that in production environment as the size of the text (font size, weight etc) will affect the amount of delay needed.

I guess I am looking for suggestions on how to tackle this rather than explicit solutions.

Any ideas?

+2  A: 

After about 7 days solid on this I got some support from printer manufacturer and resolved the problem by sending images one line at a time. This particular printer is using an image compression mechanism where a byte represents either 8 bits of graphic and can either optionally be repeated a maximum of 129 times.

I have tried breaking the data stream every so many bytes but that didn't help. I think that's because an image doesn't like to be broken up into multiple transmissions. Transmitting one line at a time (roughly 72 bytes) fixed the problem.

Igor Zevaka
A: 

Hi Igor,

I'm trying the same thing. Can you tell me how you are transmitting the image one line at a time?

Thanks,

John

Hi John,For Extech printers have a look at section "3.2 8-Bit Compressed Graphic Commands" here http://www.adtech.com.pl/upload/3750T_Developers_Manual.pdfWhenever you specify an RLE compressed image the format is as follows:`Esc, 'v', height, width, counter, value/values`Where counter either represents how many times ONE character is repeated OR a number of image characters following the counter (read the doco to see how the counter value is interpreted).The solution to my issue was to use height value of 1 and flush the buffer (i.e. send to printer) before sending another line.
Igor Zevaka