Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

How to extract pages from PDF using PDFTK

📅 2012-May-02 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ pdf, pdftk ⬩ 📚 Archive

PDFTK can be used to extract certain pages from one or more PDF files into a new PDF.

To install PDFTK, please follow the instructions here. Commands like these can be used to extract pages from a PDF file:

# Extract pages 1-3
pdftk in.pdf cat 1-3 output out.pdf

# Extract pages 2, 4 and 6
pdftk in.pdf cat 2 4 6 output out.pdf

# Extract pages 1-3 and 6-10
pdftk in.pdf cat 1-3 6-10 output out.pdf

# Extract pages 1-3 from first and 6-10 from second file
pdftk A=first.pdf B=second.pdf cat A1-3 B6-10 output out.pdf

Tried with: PDFTK 1.44


© 2022 Ashwin Nanjappa • All writing under CC BY-SA license • 🐘 @codeyarns@hachyderm.io📧