Greetings,
Is there anyway to retrieve the page count of a PDF file when loaded?
Thanks,
Mike
Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
PDF Page Count
- salvadordf
- Posts: 4563
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: PDF Page Count
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
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
-
- Posts: 21
- Joined: Tue Aug 03, 2021 7:23 pm
Re: PDF Page Count
Thanks Salvadordf,
You would think for something so basic they would expose it.
Mike
You would think for something so basic they would expose it.
Mike