HowTo: Split PDF File – Linux Command Line

Sometimes it is required to extract some pages from a PDF file and save them as another PDF document.

In Linux we can easily split PDF documents by pages using the command line utility called pdftk.

From this article you will learn how to extract individual pages or a range of pages from a PDF file and save them as another PDF document.

Cool Tip: Plan to send this PDF somewhere or just keep? How about to protect it with a password? This is really easy for ones who split PDF files from the command line! Read more →

First of all it is required to install the pdftk utility:

$ sudo apt-get install pdftk

Split PDF File

Extract the 5th page from the ORIG_FILE.pdf and save it to the NEW_FILE.pdf:

$ pdftk ORIG_FILE.pdf cat 5 output NEW_FILE.pdf

Extract several individual pages:

$ pdftk ORIG_FILE.pdf cat 1 4 6 output NEW_FILE.pdf

Cool Tip: Merge PDF files in Linux using the ghostscript command! Read more →

Extract a range of pages:

$ pdftk ORIG_FILE.pdf cat 1-5 output NEW_FILE.pdf

Extract the combination of individual pages and a range of pages:

$ pdftk ORIG_FILE.pdf cat 1 5 7 10-12 output NEW_FILE.pdf

2 Replies to “HowTo: Split PDF File – Linux Command Line”

  1. Владимир says: Reply

    Спасибо!

  2. Michael Shinas says: Reply

    Thanks for your excellent tip. I managed to change one of the commands a bit and thought it would be useful to share it here.
    My requirement was to extract all pages of a pdf file to seperate pdf files, one per page. This can be achieved as follows (The `seq -w 10` gives a sequence from 1 to 10 with leading zeros, replace 10 with the number of pages in the scan.pdf file):
    for i in `seq -w 10`; do pdftk scan.pdf cat $i output scan_$i.pdf; done

Leave a Reply