ARCHIVED: In Unix, how do I print side-by-side pages in landscape mode?

This content has been archived, and is no longer maintained by Indiana University. Information here may no longer be accurate, and links may no longer be available or reliable.

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, for personal or departmental Linux or Unix systems support, see Get help for Linux or Unix at IU.

This is document afym in the Knowledge Base.
Last modified on 2018-01-18 10:14:59.