[Tex/LaTex] Quickly extracting individual pages from a document


Let's say I have created a 100-page book with the book document class.

What is the quickest way to extract, say, pages 3, 67-70, and 80 from the book into six separate PDF files? Is there any standard tool/script out there that does this very quickly?

Manually doing this through a UI is rather tedious.

Best Answer

You can use the pdfjam tool with the syntax

pdfjam <input file> <page ranges> -o <output file>

and an example of page ranges would be


to extract page 3, pages 67 to 70 and page 80, and put these pages into a single document. Note however that this will break the hyperlinks in your document.

[edit] pdfjam is actually a front end for pdfpages, suggested in an other answer.

You could also use pdfseparate from poppler to burst a document into separate pages. Using

pdfseparate <document> 'page_%d.pdf'

using the result of pdfjam as a document will give you files named page_1.pdf … page_6.pdf containing all the desired pages.

Related Question