So, suppose you have a PDF (either something you created yourself from your own document, or for instance an RPG you bought from RPGNow
First, you will need to install three packages: ghostscript, psutils and poppler-utils. Then, paste this text into a script file somewhere in your path:
#!/bin/bash if [ $# -ne 3 ]; then echo "Usage: $0 inputfile sheets_per_signature outputfile" exit 0 fi # Strip DRM echo "Stripping DRM..." gs -q -dCompatibilityLevel=1.4 -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=/tmp/stripped.pdf $1 -c '.setpdfwrite' # Convert to PS echo "Converting to Postscript..." pdftops /tmp/stripped.pdf /tmp/stripped.ps rm /tmp/stripped.pdf # Convert to booklet echo "Converting to booklet..." psbook -q -s$2 /tmp/stripped.ps /tmp/signatured.ps rm /tmp/stripped.ps # Two pages per sheet echo "Two pages per sheet..." psnup -q -l -pa4 -2 /tmp/signatured.ps /tmp/booked.ps rm /tmp/signatured.ps # Convert to PDF echo "Converting to PDF..." gs -q -dCompatibilityLevel=1.4 -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=$3 /tmp/booked.ps -c '.setpdfwrite' rm /tmp/booked.ps echo "Done!"
What each step does is written in the comments. The crux is the call to psbook, which divides the file into signatures. It's a neat program, but it's pretty dumb: if you ask for 20 pages per signature (5 sheets), you will get 20 pages, even if the document is only 16 pages! So you're better off choosing your signature size carefully. I might write an additional script that calculates the size of the last signature, but that's something for the future.
It works well, and it works better than doing it all manually through Evince and the PDF printer driver.