66.18 PDF Rearrangements


To rearrange the pages of a pdf document, pdfjam and its front-end pdfbook are useful.

A common task is to print a booklet that is bound in the middle of each folded sheet. That is, we print two pages per sheet, double sided, the pages reordered appropriately, to create the booklet:

$ pdfbook input.pdf
$ evince input-book.pdf

Viewing the resulting pdf document shows the first page is landscape with two original pages on this single page, upside down. These are the first and the very last page from that original document. The very last page will be blank if the number of pages in the original pdf is not a multiple of 4, as in Figure 66.1. The second page will be upright and will be the second page of the original document and the second to last page of the original document. And so on. When printed all of the pages will come out the right way up.

A rearranged **pdf** document for booklet printing.

Figure 66.1: A rearranged pdf document for booklet printing.

The pdfbook command will generate some informative output and in particular will indicate the equivalent pdfjam command that is effectively run to generate the output:

$ pdfjam --booklet 'true' --landscape --suffix book --signature '4' -- input.pdf -

Your donation will support ongoing availability and give you access to the PDF version of this book. Desktop Survival Guides include Data Science, GNU/Linux, and MLHub. Books available on Amazon include Data Mining with Rattle and Essentials of Data Science. Popular open source software includes rattle, wajig, and mlhub. Hosted by Togaware, a pioneer of free and open source software since 1984. Copyright © 1995-2022 Graham.Williams@togaware.com Creative Commons Attribution-ShareAlike 4.0