title: Generate table of content using itextsharp
body: <p>What I am doing is to generate a pdf booklet from database. I need go generate a content table with page numbers. E.g there are two chapters with page number like:</p>
  
  <p>=============================</p>
  
  <p>Content table</p>
  
  <p>Chapter 1 ----- 3</p>
  
  <p>Chapter 2 ----- 17</p>
  
  <p>=============================</p>
  
  <p>The text "Chapter 1 ----- " is normal paragraph. But the page number "3" has to be produced using PdfTemplate because it can only be known later. But the pdfTemplate is absolutely positioned. How can I know where to position the PdfTemplate? Am I right on this ? How could I figure this out or should I use other methods?</p>