I am trying to generate a pdf using Itext.where i need to build a table with header. But i am adding all the content on the page dyamically by iterating the list and adding the cells to the Table ,and finally adding table to the Document after the interation is done. document.add(table);
My writer and document doesnt show me a updated page number if my content is moved on to the next page,until the table content is added to the document.I need to iterate and build the dynamic table where at the begining of the next page it should have the header of the table.I tried my level best following many approaches.But,I am unable to know when the content is moved on to next page in the middle of the iteration process.PDFWriter is showing me the page number before entering the loop.I need to get the updated pagenumber when ever the tables content goes on to next page.And i dont need this header to be on all pages.I need it only until the table content carries over.Please let me know which is the best way to handle this situation. Thanks