Install PDFtk on Ubuntu

Chưa phân loại
PDF is an integral part of our everyday life. It’s a document format that’s trusted by every single platform. Often times, important documents and books are in PDF format. It’s so widespread that without an appropriate PDF tool at hand, no system is complete. Ubuntu offers a great flexibility in terms of software availability. It’s also one of the most popular Linux distros for being so simple yet powerful and fast, extremely suitable for new to moderate Linux users. Let’s grab PDFtk – the ultimate PDF toolkit you’ll ever need!


There are 2 versions of PDFtk available – Free, Pro ($3.99) and Server. The Pro version offers all the additional features like rotating the PDF, stamping etc. The Server version is the command-line utility for performing various tasks.

PDFtk is available in the default Ubuntu software repository. However, on the latest Ubuntu releases, it’s not accessible directly. You have to use a little trick to get in on your system.

Method 1

Run the following commands –

sudo add-apt-repository ppa:malteworld/ppa
sudo apt update

sudo apt install pdftk

Method 2

You can also download and build PDFtk by yourself. For doing so, you need the Java build tools and dependencies.

Run the following commands –

sudo apt install default-jre-headless libcommons-lang3-java libbcprov-java

sudo apt install git default-jdk-headless ant
libcommons-lang3-java libbcprov-java

git clone
cd pdftk
mkdir libs
ln -st libs /usr/share/java/{commons-lang3,bcprov}.jar

ant jar
java -jar build/jar/pdftk.jar –help

Method 3 (recommended)

Install the PDFtk snap –

sudo snap install pdftk

Note that this is the “Server” version of PDFtk.

Using PDFtk

After the installation is complete, check out the app working perfectly –


In fact, running this command will show a short guide you can use. For the long, in-depth guide, run the following command –

pdftk –help

For checking out the guide later, export it to a text file –

pdftk –help > ~/Desktop/pdftk.txt

Here are some of the most used tasks you can do with PDFtk.

Encrypt a PDF (128-bit encryption)

pdftk dummy.pdf output dummy.128.pdf owner_pw foo user_pw 123

Decrypt a PDF

pdftk dummy.128.pdf input_pw 123 output dummy.unsecured.pdf

Join multiple PDFs into one

pdftk dummy1.pdf dummy2.pdf cat output dummy_merged.pdf

You can also use wildcard –

pdftk *.pdf cat output combined.pdf

Rotate PDF document (must be 1 page document)

# 90° clockwise rotate
pdftk dummy.pdf cat 1east 2-end output dummy_90.pdf

# 180° rotate
pdftk dummy.pdf cat 1-endsouth output dummy_180.pdf


ONET IDC thành lập vào năm 2012, là công ty chuyên nghiệp tại Việt Nam trong lĩnh vực cung cấp dịch vụ Hosting, VPS, máy chủ vật lý, dịch vụ Firewall Anti DDoS, SSL… Với 10 năm xây dựng và phát triển, ứng dụng nhiều công nghệ hiện đại, ONET IDC đã giúp hàng ngàn khách hàng tin tưởng lựa chọn, mang lại sự ổn định tuyệt đối cho website của khách hàng để thúc đẩy việc kinh doanh đạt được hiệu quả và thành công.
Bài viết liên quan

[BigBlueButton] [HDSD-3] Các thao tác của người tham gia phòng họp trên BigBlueButton

Ở bài trước, Onet đã hướng dẫn các bạn các thao tác của người điều hành phòng trên BigBlueButton. Trong...

How to install Spotify Client for linux on Ubuntu, Linux Mint

In this tutorial, we will be looking at how to install spotify for linux on Ubuntu. Spotify remains one of the most widely...
Chưa phân loại, vps giá rẻ

How to install Apache Subversion 1.9.5 on Ubuntu, Linux Mint

Apache Subversion (aka SVN), is a free software versioning as well as revision control system. Subversion is used mostly...
Chưa phân loại, vps giá rẻ