In Unix, how do I print side-by-side pages in landscape mode?
If you wish to print a PostScript file in Unix,
then use the
2up utility. In the printed output, the file will be
rotated and scaled so that, on each sheet of paper, there will be two
pages side-by-side in landscape mode. To use the command, at the
Unix shell prompt, enter:
2up file.ps | printcommands
Alternately, you can enter:
up -n 2up file.ps | printcommands
Replace file.ps with the name of the PostScript file you
wish to print. Replace printcommands with the appropriate
print commands for your system (e.g., lpr in
BSD-compatible systems and lp in
System V). For example,
to send the PostScript file myfile.ps to the PostScript
printer ps99, at the Unix shell prompt, enter:
2up myfile.ps | lpr -Pps99 -h
If the file you wish to print in landscape mode is a regular text
file, you will need to use the enscript command. Use the
-r and -2 switches to rotate and print two
pages per printed page. To send a text file to the default printer
(it must be a PostScript printer), at the Unix shell prompt, enter:
enscript -2r file
Replace file with the name of the text file you wish to
print.
To send the file to a different printer, use the -P (BSD)
or -d (System V) switch and specify the printer. For
example, to send the text file myfile.txt to the
PostScript printer ps99, at the Unix shell prompt, enter:
enscript -2r -Pps99 -h myfile.txt
With either enscript or 2up, if the destination
printer supports it,
you can use the psduplex filter to print the output on both
sides of the page. Extending the previous example, to use
psduplex
with 2up to send myfile.ps to
ps99, enter:
2up myfile.ps | psduplex | lpr -Pps99 -h
To use enscript to send myfile.txt to
ps99, enter:
enscript -2r -p- myfile.txt | psduplex | lpr -Pps99 -h
Note: In the examples above, the -h
switch suppresses printing of the burst page.
At Indiana University, to get support for personal or departmental Linux or Unix systems, see At IU, how do I get support for Linux or Unix?
Also see:
- Unix printing using enscript, dvips, and psduplex
- In Unix, how do I designate my default printer?
- In Unix, how do I print files and list or remove print jobs?
- In Unix, what are the up, 2up, 4up, 8up, and 16up utilities, and how do I use them to manipulate PostScript files?
- What are the PSUtils?
Last modified on August 22, 2008.






