Command Line Printing: Printing Multiple Pages of Text on One Page

Purdue Engineering Computer Network

If you want to print multiple pages of a standard text file to one page, one approach is to use the enscript program. enscript reads in plain text files, converts them to PostScript format, and spools them for printing on a PostScript printer. For example:

	% enscript foo.txt -d msa

prints a copy of the file "foo.txt" on the printer called msa.

	% enscript -2r foo.txt -d msa

prints two pages of text per page in landscape mode (-r) on printer msa.

For more information about this command, type

	% man enscript

Note, this will ONLY work on text, and NOT PostScript files. To condense the number of pages of a PostScript file requires using the psnup program. To find out more about psnup, type:

     	% man psnup

psnup provides page rotation, printing of multiple pages on a sheet of paper (n-up printing), selection of page and paper sizes, and writes the resulting file on the standard output. Using the -n option, you can specify how many PostScript pages will be printed on each sheet of paper, or a specification of the form n x m, where n and m specify rows and columns, respectively. For example:

	% psnup -n4 | lp -d msa

This will read the PostScript file called and formats it with 4 pages on a sheet of paper. The file is piped through lp to be printed on a printer called msa.

If you want to rotate it (landscape mode), use the -r option:

	% psnup -r | lp -d msa

For the best results, read the man pages:

	% man enscript
	% man psnup
	% man lp

Last modified: 2007/10/08 09:36:18.753000 GMT-4 by
Created: 2007/10/08 09:36:18.753000 GMT-4 by brian.r.brinegar.1.


Search the Knowledge Base


Quick search results

    Admin Options: Edit this Document