The mutool is a lightweight command-line utility included with the MuPDF toolkit for working with PDF documents. It provides a variety of features for inspecting, converting, extracting, and manipulating PDF files. This tutorial shows how to install mutool on Ubuntu 26.04.
Install mutool
Run the following command to update package lists:
sudo apt update
Install the MuPDF command-line utilities, which include mutool:
sudo apt install -y mupdf-tools
Testing mutool
Retrieve two sample PDF files for a quick functionality check:
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
Combine both PDF documents into a single output file:
mutool merge -o result.pdf test1.pdf test2.pdf
A new file named result.pdf will be created containing the pages from both input documents.
Uninstall mutool
If the mutool is no longer required, uninstall the package and clean up unused dependencies with the following command:
sudo apt purge --autoremove -y mupdf-tools
Leave a Comment
Cancel reply