|To control a dot matrix printer you need to embed orders inside the printing stream. There are two main printing languages for dot matrix printers, IBM Proprinter mode and Epson ESC/P mode. Here the ESC/P codes:|
0Fh to activate comp and 12h to deactivate.
As an example if you want to compress the string Hello World you have to send to the printer
where 0Fh and 12h are the symbolic for bytes holding the hex control code (in the example just one byte as prefix and one as suffix).
What I posted works for a printer supporting ESC/P, sorry but I do not have on hand the IBM Proprinter equivalent codes.