Install QPDF on Ubuntu 26.04

Install QPDF on Ubuntu 26.04

QPDF is an open-source command-line tool for inspecting, modifying, and transforming PDF documents. It supports operations such as merging multiple PDF files, splitting documents, encrypting or decrypting PDFs, rotating pages, and optimizing file structure while preserving document content. This tutorial shows how to install QPDF on Ubuntu 26.04.

Install QPDF

Run the following command to update package lists:

sudo apt update

Install the QPDF:

sudo apt install -y qpdf

Verify that QPDF has been installed successfully by checking its version:

qpdf --version

Testing QPDF

Download two sample PDF documents for testing:

curl -sSo test1.pdf https://raw.githubusercontent.com/py-pdf/sample-files/master/004-pdflatex-4-pages/pdflatex-4-pages.pdf
curl -sSo test2.pdf https://raw.githubusercontent.com/py-pdf/sample-files/master/014-outlines/mistitled_outlines_example.pdf

Merge both PDF files into a single document:

qpdf --empty --pages test1.pdf test2.pdf -- result.pdf

The resulting result.pdf file will contain the pages from both input PDF documents merged into a single PDF.

Uninstall QPDF

If QPDF is no longer required, remove it from the system along with any unnecessary dependencies by running the following command:

sudo apt purge --autoremove -y qpdf

Leave a Comment

Cancel reply

Your email address will not be published.