Home Command line utilities How To Split or Extract Particular Pages From A PDF File
Extract Particular Pages From A PDF File In Linux

How To Split or Extract Particular Pages From A PDF File

By sk
328 Views

Let us say you have a PDF file with 100 pages 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 applications. In this tutorial, I will show you a simple way to split or extract particular pages from a PDF file on Linux. 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

PDFtk is available as snap package. Make sure your system has snap installed and run the following command to install PDFtk.

$ sudo snap 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_p5-10.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 absolutely easy and handy trick 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.

Reference:

Thanks for stopping by!

Help us to help you:

Have a Good day!!

You May Also Like

3 comments

Mikkle February 9, 2017 - 12:48 pm

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

Reply
Yash Pal March 10, 2018 - 3:01 pm

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

Finally we save the output in output_p5-10.pdf file. How? by magic? ‘output_p12-15.pdf’ ‘ is the output file.

Reply
andres August 6, 2020 - 5:50 am

Thanks for posting on how to split and extract from PDF. pdftk is quite nice. There is also QPDF i havent tried it fully.
Thanks.
Have a nice day

Reply

Leave a Comment

* By using this form you agree with the storage and handling of your data by this website.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More