Tuesday, March 21, 2006

post about printing on dot matrix

I'd posted this on the PCQuest forum:
http://forums.pcquest.com/forum/viewtopic.php?t=3459
Recently I had the need to print some stuff with a dot matrix printer (TVS MSP 345) which happens to be "Epson compatible". I wanted to print with the built-in fonts, which are clearer and also print faster. So, I first prepared my pages with a text editor (kwrite) with proper formatting and then applied the extra binary formatting with a hex editor (khexedit). This basically consisted of adding the required control codes (like compressed mode, emphasise text, etc) at the relevant places.

Notes:
1. The printer took 8 spaces for tabs, had to adjust the text editor accordingly.
2. I'd set the default printer to a "Raw/No driver" printer driver in cups. Probably this is not necessary.
3. My print command was cat filename.txt > /dev/lp0 - I had to do this as root, there may be better ways to do this.
4. Epson codes were obtained after googling, from http://webpages.charter.net/dperr/links/esc_p83.htm
A note about these codes is that you need to send the ESC character for some of them, and not for others. For example, for form feed you just need to send 0c (HEX) while for select condensed mode you need to send 1b 0f (HEX).

No comments:

Post a Comment