How to stitch several PDF pages into one big canvas-like PDF?
Question: I have a 32-page PDF of my family tree. Instead of having the family tree all
on one really big PDF page (which is what I want), it is formatted so a group
of 8 individual US letter-sized pages are supposed to be stitched across the
width; 4 rows of this completes the tree. The margins of each page are all
22px.

If you visualize it in table form (where the numbers represent PDF page
numbers):

![table](http://i.stack.imgur.com/oD0u8.png)

I've tried to whip up some Python code to do this, but haven't gotten very
far. How can I stitch the PDF so it can be one big page instead of smaller
individual pages?

Thanks for the help.

EDIT: Here's the code I wrote. Sorry for not originally posting it.

    
    
    from pyPdf import PdfFileWriter, PdfFileReader
    
    STITCHWIDTH = 8;
    currentpage = 1;
    
    output = PdfFileWriter()
    input1 = PdfFileReader(file("familytree.pdf", "rb"))
    
    for(i=0; i<=4; i++)
        output.addPage(input1.getPage(currentpage))
        currentpage++;
        #do something to add other pages to width
    
    print "finished with stitching"
    
    outputStream = file("familytree-stitched.pdf", "wb")
    output.write(outputStream)
    outputStream.close()
    


Answer: As an alternative to Ben Jackson's
[suggestion](http://stackoverflow.com/questions/6577090/how-to-stitch-several-
pdf-pages-into-one-big-canvas-like-pdf/6577225#6577225) of first converting to
PostScript, and doing a "N-up" transform on the PostScript files, there's also
a utility called `pdfnup` available as part of the
[PDFjam](http://www2.warwick.ac.uk/fac/sci/statistics/staff/academic-
research/firth/software/pdfjam/) suite, that can operate directly on PDF
files. Example:

    
    
    pdfnup --nup 8x4 --outfile output.pdf input.pdf
    

