Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have two searchable PDF documents, say even.pdf and odd.pdf which contain even and odd pages of a book, respectively.

I can decompile each PDF to separate files 001.pdf 002.pdf 003.pdf, et cetera. The question is how to merge them?

They are both even and odd sequences numbered 1, 2, 3. If the numbering in the decompile process with pdftk were different, e.g. 1, 3, 5 for even and 2, 4, 6 for odd instead of 1, 2, 3, 4, I could simply merge them.

Can I do this any other way?

share|improve this question

7 Answers 7

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

pdftk A=even.pdf B=odd.pdf shuffle A Bend-1 output merged.pdf
share|improve this answer

Of the top of my head, I would combine pdftk with mmv:

  • First burst both files into separate directories, getting even/001.pdf and odd/001.pdf etc.
  • Then use mmv '*.pdf' '#1-a.pdf' on the odd folder, mmv '*.pdf' '#1-b.pdf' on the even folder.
  • Move everything into one folder. The shell expansion * should now sort odd pages before even pages (001-a, 001-b, 002-a, 002-b etc.).
  • Use pdftk as in pdftk *.pdf cat output combined.pdf

Maybe you have to do the last bit in loops for, say, the first thirty pages, then another thirty pages etc., depending on how robust your shell expansion is with many files.

share|improve this answer

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.

share|improve this answer

Check out Sejda - A New Advanced Online PDF Manipulation Tool (still in Beta)

http://sejda.com/

It has the ability to merge docs in different ways, and maybe able to accomplish your requirements above.

share|improve this answer

I use pdf Split and Merge

Besides being able to merge files it is capable of other interesting operations.

share|improve this answer

I had spent an hour looking for a solution to process three huge files until I found this forum and tried the http://sejda.com/. It has done an amazing job - exaclty what I wanted: merge two documents (one containing odd pages, and second containing even page in a reverse order). A great online service I would recommend to everyone who needs to process big pdf files. Thanks to Sejda team!

share|improve this answer

well what you are asking is slightly complicated, but for starters you could try something like Combine PDFs Free or any other page. If you have trouble let me know and i can try help :P

regards cam

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.