Manipulating PDFs

Using pdfjam to make pdf impositions

Installation

apt-get install pdfjam pdftk

For more information on pdfjam see here:
http://www2.warwick.ac.uk/fac/sci/statistics/staff/academic/firth/softwa...
and here:
http://www.ctan.org/tex-archive/macros/latex/contrib/pdfpages/pdfpages.pdf

For information on pdftk see here:
http://www.pdflabs.com/docs/pdftk-man-page/

#2 up - first rotate to portrait (two alternative, fixed page or to end)

pdftk A=TOC-2009a.pdf B=TOC-2009b.pdf cat A1-38L B1-18L output out.pdf
pdftk A=TOC-2009a.pdf B=TOC-2009b.pdf cat A1-endL B1-endL output out.pdf

#now 2-up on half letter

pdfjam out.pdf --nup 2x1 --letterpaper --landscape --outfile outl.pdf


#or if pdfnup is used:

pdfnup out.pdf --nup 2x1 --paper letterpaper --orient landscape --outfile outl.pdf

#rotate to portrait again

pdftk outl.pdf cat 1-endR output TOC-2009-2.pdf
rm -f out*.pdf

#4 up does not work because paper is landscape
pdfjam --landscape --nup '2x2' --angle '-90' --paper letterpaper TOC-2009?.pdf --outfile TOC-2009-4.pdf

#4 up works if we first convert it to portrait, but page ordering is not perfect
pdftk TOC-2009?.pdf cat 1-endL output out.pdf
pdfjam --no-landscape --nup '2x2' --letterpaper out.pdf --outfile TOC-2009-4.pdf

#alternative methods that never worked:
#first rotate to portrait
pdftk TOC-2009?.pdf cat 1-endL output out.pdf
#now 2-up on half letter
pdfjam --suffix 2up --nup 2x1 --papersize '{5.5in,8.5in}' --landscape out.pdf
#rotate to portrait again
pdftk out-2up.pdf cat 1-endR output out-2p.pdf
#final combination (does not work)
pdfjam --suffix 4up --nup 2x1 --letterpaper --landscape out-2p.pdf

#does not like working with differing size paper, so try it all in A4
#first rotate to portrait
pdftk TOC-2009?.pdf cat 1-endL output out.pdf
#now 2-up on A4
pdfjam out.pdf --nup 2x1 --a4paper --landscape --outfile out2l.pdf
#rotate to portrait again
pdftk out2l.pdf cat 1-endR output out2p.pdf
#final combination (does not work)
pdfjam out2p.pdf --nup 2x1 --a4paper --landscape --outfile out4l.pdf
#alternative final combination (does not work)
pdfjam out2p.pdf --nup 2x1 --a4paper --noautoscale true --scale .71 --angle '-90' --landscape --outfile out4l.pdf

#still doesn't work--I don't think pdfjam likes its own output as input

For other notes see here:
http://stackoverflow.com/questions/465271/gluing-imposition-pdf-documents