title: In itext7 - PdfDocument.GetNumberOfPages() returns only one page all the time
body: <ul>
  <li>I am trying to implement Page X of Y in footer part of html page. </li>
  <li>I am retrieving X by calling GetPageNumber(PdfPage) in PdfDocument and Y by calling GetNumberOfPages() in PdfDocument.</li>
  <li>PdfDocument is referenced from iText.Kernel.Pdf. But each time i am calling GetNumberOfPages(), it is returning only one page a t a time.</li>
  <li>Example : 
  When my total page is 4, I am getting footer value like below.</li>
  <li>1st page -> Page 1 of 2</li>
  <li>2nd page -> Page 2 of 3</li>
  <li>3rd page -> Page 3 of 4</li>
  <li>4th page -> Page 4 of 4</li>
  </ul>