0

I am adding Pdftable to existing pdf, Existing pdf already has footer but in some cases if table rows are more, I am inserting new page using

stamper.InsertPage(pagecount, pagesize); 

But I am not sure how I can add footer to this newly added page. What I have tried up to now is

 stamper.Writer.PageEvent = new PdfFooterClass()
  {
      //Below are the properties of pdfFooterClass whose values used for footer.
      Title = "My Sample Page"
      UserId = "007" 
  };

But this doesn't work, Please suggest what will be the right method to add footer while inserting page using stamper. I am adding my new page with different method than used in this Add Header and Footer for PDF using iTextsharp so this does't solve my problem.

Thanks in advance.

Vijay Kumbhoje
  • 1,401
  • 2
  • 25
  • 44
  • Does this answer your question? [Add Header and Footer for PDF using iTextsharp](https://stackoverflow.com/questions/18996323/add-header-and-footer-for-pdf-using-itextsharp) –  Apr 10 '20 at 03:19
  • @FeiShengWu That one is using document instance pdfwriter getInstance, In my case I am already editing page and adding page using stamper.InsertPage method. – Vijay Kumbhoje Apr 10 '20 at 03:26
  • @FeiShengWu My problem is getting event for newly added page, The above one doesnt address it when page added using stamper. – Vijay Kumbhoje Apr 10 '20 at 03:40
  • 1
    Page events only are triggered when itext creates pages automatically when you add content to a `Document`. When you yourself add pages manually, there is no need for page events, simply draw the footer onto each page you add manually. – mkl Apr 10 '20 at 09:02

0 Answers0