pdfjs icon indicating copy to clipboard operation
pdfjs copied to clipboard

is there any option to find total number of pages in PDF?

Open santhoshnkl3 opened this issue 3 years ago • 1 comments

I could not see the option to find the total number of pages in both external pdf document and doc created in pdfjs. is there any method available to get the total number of pages in PDF?

santhoshnkl3 avatar Aug 20 '20 05:08 santhoshnkl3

The only place where the total page number is available is in the footer, see second example of https://github.com/rkusa/pdfjs/blob/master/docs/header.md. But from the question, this is probable not what you are looking for. There is unfortunately not other API to get the page count outside of the footer. (Except accessing the doc._pages array, but this is not recommended since it is part of the internal API and might not reflect the number you expect since its value depends on how far the rendering of the document already got)

rkusa avatar Aug 20 '20 07:08 rkusa