How To Split or Extract Particular Pages From A PDF File

Extract Particular Pages From A PDF File

Let us say you have a 100 pages PDF file, and you want to split or extract particular pages from that file. How can you do that? It’s absolutely easy. You don’t need to buy or complicate with any premium PDF editing softwares. In this tutorial, I will show you a simple way which works on most Linux distributions, and other modern operating systems. Though there are so many methods to do this task, I find the following methods are the easiest way to extract a page range or a part of a PDF file in Linux. Just follow these simple steps described below to get this job done in couple minutes.

Split Or Extract particular pages from A PDF file using PDFtk

I will explain both command line and GUI way. If you use a system that has only CLI mode, follow these steps.

PDFtk is free graphical tool that can be used to split or merge PDF files. You can use it both in CLI and GUI mode. It is available for free and paid.

Install PDFtk

In Arch LInux and derivatives:

PDFtk is available in the AUR. You can install it using packer or yaourt front-ends. Just install any one of the tool. It is not necessary to install both.

After installing Packer or Yaourt, run the following command to install PDFtk.

yaourt -S pdftk

Or,

packer -S pdftk

In Debian, Ubuntu and derivatives:

sudo apt-get install pdftk

On CentOS, Fedora, Red Hat:

First, Install EPEL repository:

sudo yum install epel-release

Or

sudo dnf install epel-release

Then install PDFtk application using command:

sudo yum install pdftk

Or

sudo dnf install pdftk

Usage

Once you installed PDFtk, open your Terminal and extract a range of pdf files as shown below.

pdftk source.pdf cat 5-10 output output_p12-15.pdf

Here, source.pdf is my original PDF file. We extract pages from 5 to 10. Finally we save the output in output_p5-10.pdf file. Very simple, isn’t it?  Of course, it is. Similarly, you can extract as many as pages you want from a PDF file.

If you want split specific pages from the source file, for example 5, 6, and 10, just run:

pdftk source.pdf cat 5 6 10 output output.pdf

The above command will split the pages 5, 6 and 10 from the source.pdf file and save it as output.pdf file.

Extract particular pages from PDF file using default PDF reader application

This is another extremely easy and dirty hack to extract pages from a PDF file using the default PDF viewer application. Most of desktop Linux distributions comes pre-installed with PDF reader application by default. We can use it to extract a particular set of pages from a PDF document.

Here is how I did it in my Arch Linux desktop.

Open the source pdf file using any PDF reader. For the purpose of this tutorial, I use Atril Document Viewer.

Go to File -> Print.

Menu_013

Select Print to file as printer, enter the output filename, select format as PDF, enter the page range (Here 30-40). And finally click Print.

bgita.pdf — Bhagavad Gita_015

The selected pages will be extracted from the PDF file. That’s it.


Want to know how to merge PDF files? Check the following link,


As you can see, both methods are simple, straight-forward and easy to follow. If you use any GUI desktop version, the second method is opt.

Hope this helps. More good stuffs to come. Stay tuned.

Cheers!!

Reference:

Thanks for stopping by!

How can I benefit from this blog:

Have a Good day!!

You may also like...

  • Mikkle

    Extracting from your pdf viewer may not preserve page dimensions. This happened to me when using Okular. I had no problem using pdftk.