PDF

Install PDFtk on Ubuntu

Install PDFtk on Ubuntu
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!

PDFtk

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 https://gitlab.com/pdftk-java/pdftk.git
 
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 -

pdftk

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

Enjoy!

Gry Najlepsze gry do grania ze śledzeniem rąk
Najlepsze gry do grania ze śledzeniem rąk
Oculus Quest niedawno wprowadził świetny pomysł śledzenia rąk bez kontrolerów. Przy stale rosnącej liczbie gier i działań, które wspierają zarówno for...
Gry Jak wyświetlić nakładkę OSD w pełnoekranowych aplikacjach i grach dla systemu Linux?
Jak wyświetlić nakładkę OSD w pełnoekranowych aplikacjach i grach dla systemu Linux?
Granie w gry pełnoekranowe lub korzystanie z aplikacji w trybie pełnoekranowym bez rozpraszania uwagi może odciąć Cię od istotnych informacji systemow...
Gry 5 najlepszych kart do przechwytywania gier
5 najlepszych kart do przechwytywania gier
Wszyscy widzieliśmy i uwielbialiśmy strumieniowe rozgrywki na YouTube on. PewDiePie, Jakesepticye i Markiplier to tylko niektórzy z najlepszych graczy...