I have a Delphi application that needs to validate existing PDF documents. One task is to get (and optionally change) the version of the PDF document, check if it is password protected in any way and check if it is optimized for fast web view (and optimize if needed). I did try a few native Delphi PDF tools but was unlucky to find one that does it all.
After searching the Internet for a PDF library I could use, I've stumbled on an open source C++ QPDF - a command-line program that does structural, content-preserving transformations on PDF files.
QPDF is capable of creating linearized (also known as web-optimized) files and encrypted files. It is also capable of converting PDF files with object streams (also known as compressed objects) to files with no compressed objects or to generate object streams from files that don't have them (or even those that already do).
QPDF is not a PDF content creation library, a PDF viewer, or a program capable of converting PDF into other formats. In particular, QPDF knows nothing about the semantics of PDF content streams. Once you have a valid PDF file, QPDF can be used to transform that file in ways perhaps your original PDF creation can't handle. For example, programs generate simple PDF files but can't password-protect them, web-optimize them, or perform other transformations of that type.
Read the full article to learn about TQPDF - Delphi Wrapper for the QPDF Library