PdfPageCount (Delphi only) Limitation: The PdfPageCount function will return -1 (no result) whenever PDF files are encrypted (ie have access protection). While this code isn't polished, it's quite functional.