# Join multiple pdfs, sorted by alpha pdfjoin *.pdf
# Join pdfs as listed pdfjoin 1.pdf 2.pdf 3.pdf
# Join everything into a pdf pdfjoin *
I had a number of brief PDF files that I wanted to merge together into a single concatenated PDF. This is the sort of task that typically leads me down a rabbit hole of abandoned scripts and obscure apps.
The resulting combined file from ghostscript (
gs) had mangled tables and askew images. Unfortunately, the output was unusable.
pdftk sounded promising, but the install process for Arch is ridiculous. There’s a yaourt package, but it relies on
gcc-gcj (ugh, java) and
gcc-gcj-ecj (a fork of the Eclipse bytecode compiler, double ugh). The compilation time was far more than I cared to wait for this sort of task, and I eventually killed it.
Imagemagick worked, but their
convert util rendered text as images so the output PDF was unsearchable. The text was blurry and for reasons unknown my jobs were being killed when I tried to use sane values for higher quality results. That seemed odd considering I’m on a modern machine with ample RAM.
The winner for me was
pdfjoin ala the
It generated a relatively small file, text was rendered properly and was searchable, tables and graphics were properly rendered, and it was high quality.