64.8 PDF Extract Pages

20210419 For example, to extract all but the first page from a pdf document:

$ pdftk input.pdf cat 2-end output output.pdf

Input pdf documents can be named, as in the next example, as A, B, etc., and then referred to when specifying page ranges later. The example appends page 1 from document B (input2.pdf) to pages 1-8 of document A (input1.pdf). A use case is a contract where the last page (page 9 here) needs to be signed and scanned. That page is then appended to the remaining pages of the contract.

$ pdftk A=input1.pdf B=input2.pdf cat A1-8 B1 output output.pdf

The A and B can appear multiple times:

$ pdftk A=input1.pdf B=input2.pdf cat A1-8 B1 A10-12 output output.pdf


Your donation will support ongoing availability and give you access to the PDF version of the 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-2021 Graham.Williams@togaware.com Creative Commons Attribution-ShareAlike 4.0.