# Is it possible to get the document total page count from a WebViewer instance?

**URL:** <https://pdfjs.community/t/is-it-possible-to-get-the-document-total-page-count-from-a-webviewer-instance/771>\
**Category:** Technical Support\
**Created:** [May 17, 2021, 5:35pm UTC](https://pdfjs.community/t/is-it-possible-to-get-the-document-total-page-count-from-a-webviewer-instance/771 "2021-05-17T17:35:54Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![carlos](https://avatars.discourse-cdn.com/v4/letter/c/ecae2f/32.png) [@carlos](https://pdfjs.community/u/carlos)\
**Post date:** [May 17, 2021, 5:35pm UTC](https://pdfjs.community/t/is-it-possible-to-get-the-document-total-page-count-from-a-webviewer-instance/771/1 "2021-05-17T17:35:55Z")

</div>

**PDF.js Express Version**  
7.3.2

**Detailed description of issue**  
Hi guys, I am launching a WebViewer instance, and wonder if it contains the total number of pages of the document the instance loads.

**Expected behaviour**  
I found a getPageCount() method but on the “DocumentViewer” class… wondering if there is something similar I could call when I create an instance of the Web viewer:

```
WebViewer(
    {
        etc
    },
    viewer.current,
).then((instance) => {
     --> I need to get the loaded doc's total page count in here

```

**Does your issue happen with every document, or just one?**  
Any document.

**Link to document**  
Not applicable.

**Code snippet**  
WebViewer(  
{  
etc  
},  
viewer.current,  
).then((instance) =\> {  
 → I need to get the loaded doc’s total page count in here

Thanks!

---

_[View the full topic](https://pdfjs.community/t/is-it-possible-to-get-the-document-total-page-count-from-a-webviewer-instance/771)._
