Page 1 of 1

PDF Page Count

Posted: Fri Jun 03, 2022 5:31 pm
by miket@cbofks.com
Greetings,

Is there anyway to retrieve the page count of a PDF file when loaded?

Thanks,
Mike

Re: PDF Page Count

Posted: Sat Jun 04, 2022 6:23 am
by salvadordf
I'm not aware of any API call that returns that information.

Some people claim that you can use a hack to get the current page in the PDF document :
https://stackoverflow.com/questions/55087949/chrome-extension-how-to-get-current-page-number-of-opened-pdf-file-on-browser

If that's true, perhaps you can simulate some key presses with DevTool methods to open the last page and then get the page number.

There seems to be some solution for this if you use JavaScript :
https://stackoverflow.com/questions/10253669/how-to-get-the-number-of-pages-of-a-pdf-uploaded-by-user

Re: PDF Page Count

Posted: Mon Jun 06, 2022 11:47 am
by miket@cbofks.com
Thanks Salvadordf,

You would think for something so basic they would expose it.

Mike