Ghostscript — The most capable free PDF command-line tool. Originally a PostScript/PDF interpreter, Ghostscript can convert PDFs to images, compress PDFs (re-rendering all content through its PDF writer), split and merge pages, flatten transparency, and convert between PDF and PostScript. The pdfwrite device is the Swiss Army knife of PDF manipulation. Open source (AGPL); commercial licence available for embedding. Key commands:
gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dPDFSETTINGS=/ebook -sOutputFile=out.pdf in.pdf
qpdf — A structural PDF transformation tool that understands PDF internals deeply. Excellent for: linearising PDFs, splitting by page range, merging, decrypting password-protected PDFs (when you know the password), and inspecting PDF structure. Does not re-render content — performs lossless structural operations. Open source (Apache 2.0). Key command:
qpdf --linearize --pages in1.pdf 1-5 in2.pdf 1-3 -- output.pdf
Poppler — PDF rendering library with a suite of command-line tools:
pdftotext (extract text),
pdftoppm (render pages as images),
pdfinfo (document metadata),
pdfdetach (extract embedded files),
pdfimages (extract embedded images). Used under the hood by many Linux desktop applications. LGPL licence. Essential for PDF content extraction in data processing pipelines.
pdftk — Popular for its simple command syntax for merging, splitting, stamping, and filling forms. The original pdftk is no longer maintained;
pdftk-java (actively maintained) is the current alternative. Does not support PDF 2.0 fully. Good for: merging PDFs, stamping watermarks, fill-and-flatten form data, rotating pages.
pdfcpu — A newer Go-based PDF tool with strong PDF 2.0 support, page manipulation, form operations, watermarking, and a growing API. Open source (Apache 2.0). Actively maintained as of 2024.