Printing an arbitrary PostScript document as a booklet

Tags:

Use the ps2book script, documented here.

The above, a "non-trivial wrapper around" the psutils package, includes code that will insert PostScript "cookies" to force the correct double-sided printing on capable printers.

From http://wiki.scribus.net/canvas/How_to_make_a_booklet is the following set of notes and an alternate method:

Using ps2book

This is a slight modification of Method A that uses ps2book, a wrapper around the psutils commands. It requires only 3 steps, but I am cheating ;-).

1) Change the document format to postscript:

pdftops -level3 file.pdf

This creates a postscript file named 'file.ps' (pdftops [from the xpdf family] does a much better job than pdf2ps [from ghostscript] in my opinion).

If you want to print the resulting PS file, rather than converting it to PDF, you might need to use `-level2' if your printer only understands PostScript level 2.

2) Call ps2book:

ps2book file.ps

This creates a file named 'file_book.ps'.

ps2book has a number of options; a few useful ones are

ps2book -Pdisplay file.ps  # show result in gv
ps2book -f1.0 file.ps      # set `fill factor' to 1, based on document bounding box
ps2book -F0.87 file.ps     # set `fill factor' to 0.87, based on true bounding box
ps2book -m letter file.ps  # set output medium

The option `-f1.0' will do the right thing for 2xA5 -> A4 booklets, provided the document bounding box covers the whole paper size (which is the case with pdftops).

The `-F0.87' is what I normally use for printing almost anything as a booklet (leaves a 6.5% margin on each side).

ps2pdf tries to be clever about the output medium, but if it fails, use `-m' to set it explicitly.

3) Either print 'file_book.ps' directly, or transform it back to pdf:

ps2pdf13 file_book.ps

This creates the file 'file_book.pdf' (ps2pdf13 or ps2pdf14 often produce much more compact PDF than ps2pdf which by default writes PDF version 1.2; it is very hard to find somebody who cannot read PDF 1.3).

Alternate: Using psutils only

1) Change the document format to postscript:

pdf2ps file.pdf

This creates a postscript file named 'file.ps'

2) Change the order of the pages:

psbook -s16 file.ps fileA.ps

Where 16 is the number of pages that your document has. It should be a multiple of four.

3) Arrange the pages so two logical pages are printed on one physical sheet:

psnup -2 -w21cm -h16.3cm -W10.5cm -H16.3cm fileA.ps fileB.ps

Which arranges two logical pages of the size 105x163mm on a sheet of the size 210x163mm. If you have different page sizes, then simply change the dimensions. (Take a look to the man page of psnup) You can alternatively use the -p and -P flags to indicate page sizes:

psnup -2 -pa4 -Pa5 fileA.ps fileB.ps

which will take two A5 pages and put them on A4 paper.

4) Transform it back to pdf:

ps2pdf fileB.ps

This creates the file 'fileB.pdf'.

5) Print 'fileB.pdf' with the program of your choice.