How can I combine two PDF pages show up on the same page?

Boris Gorelik picture Boris Gorelik · Feb 11, 2009 · Viewed 79.4k times · Source

I am looking for a free tool that allows re-arranging pages of a PDF document and combining multiple pages per sheet. The first part (re-arranging) is easily solved by many tools (I use PyPDF).

The problem is with the second requirement: to combine two (or more) pages into single page. For example, take two pages (A and B), rotate them, scale and combine into a single page like this

------       ------            ------
|     |      |      |          |     |
|  A  |      |  B   |          | a   |
|     |      |      |          |     |
|     |      |      |  --->    ------
|     |      |      |          |     |        
|     |      |      |          | b   |        
|     |      |      |          |     |        
------       ------            ------

The solution needs to work on Linux and preferably on Windows too. I'm looking for either console application or library with Python or Perl bindings.

Edit there is pdfnup library that is supposed to perform exactly this kind of transformation, and is cross-platform, however I cannot use it due to a bug similar to this.

Answer

Mildred picture Mildred · Jul 22, 2010

This is a summary of the tools I found for PDF (I wanted to find the equivalent of psup and psbook)

  • Create booklets: pdfbook, pdf-tools (command: pdfbklt)
  • Merge PDF files: pdfmerge, pdfjam (command: pdfjoin)
  • Rotate pages: pdfjam (command: pdf90)
  • Multiple pages per sheet: pdfjam (command: pdfnup)
  • Create posters (multiple sheets per page): pdfposter

From my package manager:

Create an A6 booklet:

pdfbook -2 -p a5 infile.pdf outfile.pdf

pdf-tools contains:

  • pdfbklt: create booklets
  • pdfrevert: Removes one layer of changes to a PDF file, trying to maximise the size of the output file (to account for linearised PDF).
  • pdfstamp: Adds the given string to the infile .pdf file at the given location, font and size.

There is also multivalent: http://multivalent.sourceforge.net/Tools/index.html