You can use command a2ps. For example, if you have a text file called input.txt and you want to print the file 4 pages per sheet, then you can use the following command to generate an output file called output.ps, then use lpr command to print the output.ps
a2ps -o output.ps -4 input.txt
lpr -Pprintername output.ps
Note that
- a2ps convert FILE(s) or standard input to PostScript. Input files can be of different type, e.g. .txt, .ps, or .html.
you can directly print out the input file to printer by the following command:
a2ps -P -4 input.psHowever we recommend to convert the input file to output.ps first, then use ghostview to check if the format is correct or not. Finally use lpr command to print output.ps.
- For further information, please use command man a2ps to read the manual of the command a2ps.
FAQ Category