Duplex Printing with CUPS Tips and Tricks


The HP LaserJet printer in ME10b has a duplexer attached to it, which allows the printer to automatically print on both sides of the paper.

Long-side vs. Short-side Duplexing

Before you print duplex, you must first determine whether you want the output to be printed for "Long-side Binding" or "Short-side Binding". Choosing Long or Short side binding determines how whether or not the printer flips the page when printing on the back side. This is best explained using an illustration:

duplex binding

Basically, determine whether or not your material is portrait or landscape, and choose which of the above images reflects the way you plan on binding/stapling/stacking your printed output. For numbers 1 and 2, use the "Long-Side Binding" queues (use the "-o Duplex=DuplexNoTumble" option with lpr), while for 3 and 4 use the "Short-Side Binding" queues (use the "-o Duplex=DuplexTumble" option with lpr). See below for examples.

In general, most material works best with Long-Side binding. One important exception is printing booklets (see below).

Producing Booklets

If you have a duplex printer, it is also quite easy to produce half-sized booklet (i.e. each page is 5.25" by 8") without wasting any paper.

The first step is to create a postscript file, where each page is a normal 8.5" by 11" page. For this example, I'll assume the name 'file.ps'. Basically, you just tell the application to print to a file without doing anything special.

Next, you need to re-arrange the order of the pages into "signatures". This rearranges the pages so that when you print them out you only have to fold or cut the stack of paper in half, and the pages will already be in the right order. To do this, simply run 'psbook' on the file:

psbook file.ps > signature.ps

Next, this "signature" needs to be converted "2-up" (two reduced pages per page) to make the booklet:

psnup -2 -Pletter -pletter signature.ps > booklet.ps

Now you print this booklet to the printer, using the short-side binding queue:

lpr -o Duplex=DuplexTumble -Pme10b booklet.ps

Now simply take the printout, fold it in half (or cut in half it if it is longer), and staple or bind it.

For examples of a printed "signature" and a finished booklet, or to see how to comb-bind something, see Rich in me155.

For advanced users...

If you are regularly printing booklets, you can combine the above steps into a single command line, skipping the intermediate.ps files:

psbook file.ps | psnup -2 -Pletter -pletter | lpr -o Duplex=DuplexTumble -Pme10b

Also, if your pages have small margins, you may wish to move the pages out towards the edge of the paper to give more room for stapling/binding. You can use 'pstops' to do this. To given an additional 0.5in (before reduction) of margin for binding:

psbook file.ps | pstops -pletter "2:0(-0.5in,0in),1(0.5in,0in)" |psnup -2 -Pletter -pletter | -o Duplex=DuplexTumble -Pme10b
See the man page for 'pstops' for more details.