Friday, December 19, 2008

Raw Printing in Linux

Raw printing in Linux is achieved by issuing the command and piping the result to /dev/lp0. For example:

# ls -l > /dev/lp0

Raw printing is useful if you want to take advantage of fast printing using the default fonts of the printer. More often, this is useful if you will be printing under a dot matrix printer.

Furthermore, you can also issue printer codes to the printer to make condensed printing as follows:

# echo -ne '\033\017' >> /dev/lp0

The printer code "\033\017" is an octal equivalent for condensed printing under an Epson-like dot matrix printers. Commonly, the following codes may also be used:

\033\115 for elite and \033\120 for pica

If you are using a different dot matrix printer, the printer codes are found in your printer manual.

No comments: