title: Itextsharp PdfDocument or PdfDocument from It.Document
body: <p>I am adding page numbers to the bottom of a pdf document using ITextSharp
  The thing is, it is made up of 4 or 5 different PDF's that are combined through the process, and there are some dynamically added pages so the PDF can vary in size. I cannot call document.PageCount because it "lacks the get accessor". </p>
  
  <p>I made a counter to keep track of what page I am on, and can get the final page to say "Page 9 of 9" but the rest only say "Page 7 of ".
  I was thinking that I could run the whole document through a PdfReader to call reader.NumberOfPages and rerun each page and add the final number at the bottom but I do not know how to make one from a type iTextSharp.text.Document, nor how to go about it afterwards.</p>
  
  <p>This is a project started by someone else, and I've barely touched iTextSharp before, I cannot remake class because it is too huge.</p>
  
  <p>Does anyone know what I can do? Or how to go about adding that 1 number to each page of an iTextSharp.text.Document?</p>