When searching for the "top" tool, is almost always the first recommendation. It is a powerful command-line program that does "structural, content-preserving transformations" on PDF files. GitHub Repository: qpdf/qpdf

Power users and system administrators who need a reliable, battle-tested tool. 2. Pikepdf: The Pythonic Powerhouse

If you want, I can: