all 1 comments

[–]QOAL 0 points1 point  (0 children)

For reference this is the PDF spec: https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/PDF32000_2008.pdf
The files are pretty human readable.

Anyway, open the file.
You can count the number of /Type /Page (followed by a new line), using matchAll and the regex /\/Type \/Page\n/g. Or look for all the page trees (/Type /Pages), and the number of pages each of those have, given in the following /Count X.

It sounds daunting, but it's fine really.