Introduction
Sometimes, to manage multiple PDF files effectively, the best solution is to merge them into a single file. While web or cloud-based tools exist, uploading files containing sensitive personal information to external servers is not ideal from a privacy standpoint. In such cases, command-line tools can process your files locally with minimal effort. PDFUnite is one such command-line tool.
Installation
In most Linux distributions, package managers handle the installation. On Debian and Ubuntu systems, apt handles it via the poppler-utils package:
sudo apt install poppler-utils
Arch Linux distributions can use pacman:
sudo pacman -S poppler
And RPM-based distributions like Fedora can use dnf:
sudo dnf install poppler-utils
If you need to compile it from source, documentation and source code are available at the Poppler rendering library website.
Basic usage
PDFUnite is straightforward. To merge multiple PDF files, run:
$ pdfunite first.pdf second.pdf output.pdf
Where:
first.pdfandsecond.pdfare the input files to be merged.output.pdfis the resulting combined PDF file.
Reducing file size
If the resulting combined PDF file is too large, you can compress it following the instructions in this guide: Linux shell script to reduce PDF file size.