Notice! This document is currently in Archived status.
The content of this document may be incorrect or outdated.

Print this article Edit this article

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 foo.ps | lp -d msa

This will read the PostScript file called foo.ps 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 foo.ps | lp -d msa

For the best results, read the man pages:

	% man enscript
% man psnup
% man lp

Last Modified: Aug 1, 2023 4:07 pm GMT-4
Created: Oct 8, 2007 9:36 am GMT-4 by admin
JumpURL: