title: How to obtain the total page count for a pdf in iTextSharp?
body: <p>I've created a class that extends PdfPageEventHelper to add a specific message at the end of the page. The problem is that this text need to be added only to the end of the PDF (if I have 3 pages this text need to be displayed only on the footer of the last page).</p>
  
  <p>In the OnEndPage function of the PdfPageEventHelper class I use document.PageNumber to know what page I'm modifying, but how can I know if this page is the last one?</p>
  
  <p>Thanks.</p>