How to Print in Allen Center

(without killing too many trees)

Why read this page?

All too often, you see 50 pages of single-sided full-sized class slides printed out. This is kind of a waste as most of the time, people can handle much more than 1 slide on each 8"x11" page. This page is meant to be a quick reference on how to print in allen center in duplex and 2-up, 4-up, and 6-up modes (where you have 2, 4, or 6 pages, respecitvely, shunken onto one side of paper). By all means, if you need 50 pages of single-sided printouts, go ahead and do it. This page isn't here to chastize, but rather to educate people so they don't go printing stuff that way for lack of a better method.

Managing your print jobs (deleting them)

You print jobs have to be managed in Unix. There is no way around this. The two command that you need to be familiar with are lpq and lprm.

To see the current status of the queue for a particular printer (how many jobs there are, is it stuck, etc), you use lpq. The following command prints out the queue information for the printer ps002.

lpq -Pps002

The following command will remove the current active print job (incase something gets stuck).

lprm -Pps002

The lprm can also take in the job number for lpq, or a username to try and remove all of a particular user's job. The following will remove all the print jobs for the user awong on printer ps002.

lprm -Pps002 awong

The lprm command is very good to know. If you print something and find out that the queue is too long MAKE SURE YOU DELETE YOUR PRINT JOB FROM THE QUEUE.

Printing duplex {2,4,6}-up in Windows

Printing duplex (on both sides of a sheet of paper) in 2-up, 4-up, or 6-up mode in windows is really easy. You just need to go to the preferences page for the printer and select the duplex mode and the number of pages per sheet. Here is a step by step example of how to print a set of lecture slides (usually they're landscape) in 4-up, duplex mode.

First, in the print dialog box, click on the preferences button.

In here, you have a number of options including orientation, duplexing (Print on Both Sides), Page Order, and Pages Per Sheet (2-up, 4-up, 6-up, modes).

First, we'll choose to print 4 sheet per page. Notice the change in the graphic when you click on this.

You've just managed to cut down the number of pages printed by a factor of 4! Congratulations! Now, let's cut in half again by duplexing the sucker.

On the duplex options, you have Flip on Long Edge and Flip on Short Edge. This selects which edge do you want to flip over to see the next page. If you pick the wrong one, your pages come out upside down. The general rule of thumb is that if your text is oriented up along the long edge, then you flip on the long edge. Otherwise you want to flip on short edge.

When you look at the options, you'll notice that the text is laid out with characters facing up on the short edge of the page, so we'll want to select Flip on Short Edge.

Printing in Linux

Printing Overview

Printing from Linux involves a few layers, but once you get the ideas you can combine them in simple and powerful ways.

At the bottom, the lpr command basically sends out raw data to the printer. The printers understand Postscript (often .ps, the format you'll conveniently find most papers published online in), but if you want to print any other sort of file you'll need a program to translate it to Postscript.

lpr works like this:

lpr -Pprinter options filename
The printers available to undergrads correspond to the labs; for example, ps002 is the printer in 002.

Some common options are:

So the common tree-preserving print command to use is something like:
lpr -Pps002 -Zduplex -h filename

To print from a graphical program, like Mozilla or xpdf, you must tell it the printer command. (They output Postscript themselves, so you just need to point them at the printer.) When you go to print, pick properties, then give it an lpr command line without a filename:



It'll remember this setting, so you won't need to enter it again unless you want to change it.

Printing Multiple Pages per Sheet

To print multiple sheet per page, you can replace he lpr command with the mpage command. So, looking at the previous example of mozilla, you could replace the line

lpr -Pps002 -Zduplex -h 
with
mpage -Pps002 -t -l -4 

The mpage manpage has more details on the options, but here are some switches to get you started:

You'll notice that mpage is kind of different from the rest of the printer commands in how it uses its switches. Also, it doesn't have a -h option to supress headers. Oh well. Another program you can consider using is psnup. You'd use it more like the way you'd use enscript below where you create another file and print that.

Printing Code

If you have plain text, you can send it to the printer with lpr. But it doesn't look very cool! The enscript command takes in plain text and produces fancy-looking Postscript.

The enscript manpage goes into the gory details, but here are some switches to get you started:

If you're concerned about how it'll look, you can use the gv command to view a postscript file before you print it. gv on some enscripted output looks like this:

NOTE! gv will only work if you are using a Linux workstation or Reflection X in Windows.

So, combining everything above, if I wanted to print out my Java homework, but first check that it'll look ok, I might do this:

enscript -2 -E -G -o output.ps myhomework.java
gv output.ps
lpr -Pps002 -Zduplex -h output.ps

More Info

For more information on printing in the CS department, check the CS support's printing page.

Also checkout the UWACM's tutorials page for the latest version of this document and other computing info.

Acknowledgements

This document was written by Albert J. Wong (awong at cs) and Evan Martine (martine at cs).