Merge two PDF files containing even and odd pages of a book

Solution 1:

A simple solution would be to use only pdftk in the following way:

pdftk A=odd.pdf B=even.pdf shuffle A Bend-1 output merged.pdf

This also works if odd pages are scanned first and then even:

pdftk A=file.pdf  shuffle A1-X Bend-Y output new-file.pdf 

where X is the last odd page and Y is X+1.

Solution 2:

From the PDFtk homepage:

PDFtk has a special feature that we added specifically to solve this problem of arranging scanned pages: shuffle. Say you have two PDFs: even.pdf and odd.pdf. Then you can collate them into a single document like this:

pdftk A=odd.pdf B=even.pdf shuffle A B output collated_pages.pdf

If your even pages are in reverse order, you can reverse its page range:

pdftk A=odd.pdf B=even.pdf shuffle A Bend-1 output collated_pages.pdf

The shuffle feature works by taking one page at a time from each of the input page ranges and assembling them into a new PDF. You specify these ranges after the shuffle keyword, and you can have more than two ranges.

An example of the use of more ranges is:

pdftk A=odd.pdf B=even.pdf shuffle A1 B1 A5-6 B2-3 output out.pdf

in which case the output contains the first page of A (A1), the first page of B (B1), then the fifth page of A, the second of B, the sixth page of A and finally the third page of B.