2

Is it possible to exchange odd and even pages in a pdf file, e.g. page 1 and page 2 exchange, page 3 and page 4 exchange, ..., assuming the pdf file has even number of pages?

Can it be done using some software e.g. pdftk or LaTeX?

9

It seems like pdftk's shuffle feature will do this. From man pdftk:

      shuffle [<page ranges>]
             Collates pages from input PDFs to create a new PDF.  Works
             like the cat operation except that it takes one page at a
             time from each page range to assemble the output PDF.


The general format for a [<page range>] is given as

<input PDF handle>[<begin page number>[-<end page number>[<qualifier>]]][<page rotation>]

where qualifier may be either even or odd. In the case that you wish to take alternating even and odd pages from the same document until all pages are exhausted, you can omit the <input PDF handle> and <begin page number>-<end page number> specifiers leaving just

pdftk infile.pdf shuffle even odd output outfile.pdf

where infile.pdf is the file whose pages are to be swapped and outfile.pdf is a name for the output.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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