Quantcast
Channel: CodeSection,代码区,Linux操作系统:Ubuntu_Centos_Debian - CodeSec
Viewing all articles
Browse latest Browse all 11063

How to extract particular pages from PDF file

$
0
0

Let us say you have a 100 pages PDF file, and you want to 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 tell you a simple way that works on most linux distributions, and other modern operating systems. There are so many methods to do this task. However, I find this is 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.

Extract particular pages from PDF file using PDFtk

I will explain both command line and GUI way. If you have onlyCLI 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.

How to install Yaourt on Arch Linux How to install Packer on Arch Linux

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

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

suod 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.

Extract particular pages from PDF file using default PDF reader application

This is another extremely easy and brilliant method to extract pages from 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 .


How to extract particular pages from PDF file

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 .


How to extract particular pages from PDF file

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

Download our complementary guide now!

Download our complementary guide now! Free eGuide: “5 Tools to Convert and Edit the PDF Format”

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. Happy weekend!

Cheers!!


Viewing all articles
Browse latest Browse all 11063

Trending Articles