Printing Two Pages on a Single Sheet in a UNIX Environment

Compiled by: Daniel Tse, Ravi Grewal, Ryan Mallory, Lucas Ngo, Mike Phan, Dave Wakulchuk

"The formatting (albeit sparse) is only visible in a graphical browser that supports web standards. Since we're feeling good (and thanks to stylesheets... well mostly due to style sheets) you can see all the content on this page in simple text. Enjoy!"

Ever wish you could print two pages on one? Not only does it save you money* but also saves trees and uses up needless white space. Whether its code, a text file or even a pdf, this application note will show you how to print two pages onto a single sheet of paper.

Conventions used in this application note:

Postscript files:

Postscript files are to UNIX what pdf’s are to PC’s (and the rest of the world). Postscript files (often ending in the extension .ps) allow any viewer/printer to view/print exactly what the document should look like.
To print two pages onto a single sheet use the following command:

psnup -2 file.ps | lpr

PDF files:

PDF files are prolific throughout the entire internet, PDF files (ending with the ‘.pdf’ extension) are similar to postscript files in that they allow a person to generate a document that will be viewed exactly the way he or she intended to be viewed. A major difference between PDF’s and Postscript files are that PDF was a type of file generated by Adobe Incorporated.
To print two pages onto a single sheet use the following commands:

pdf2ps file.pdf file.ps
psnup -2 file.ps | lpr

Text Files

Basic text files are defined as those without any format such as bold, italics, underline, etc. Tabs and spaces are not defined as formatting devices in this case. Text files, VHDL code, C(++) code, html files, etc can all be done this way. If you have any doubt, print the document to a postscript file and use the command listed in the Postscript Files category.

enscript -2 file.vhdl file.ps
psnup -2 file.ps | lpr

Troubleshooting

Depending on the network, and the way the printer may be setup some difficulties may arise. Here are a few solutions to some possible problems:

Final Note

If you wanted to print more than 2 pages on a single sheet (i.e. 4, 6, or 8) you can interchange the -2 with the number of pages you would like i.e. -4 or -6

*At the time of writing, printing costs at the university are at a ridiculous rate of $0.11/page while printing in an EE lab only costs $0.05/page. By printing two pages onto a single sheet, you may be able to cut down your printing costs in half or even to a quarter of that with CNS.

Please e-mail Dan (daniel.tse@ualberta.ca) if you have any questions about this application note.