IText PdfPTables, document.add with writeSelectedRows
I am currently modifying an existing system that generates reports with iText and java. The report template looks like this:
Header1 (PdfPTable)
Header 2 (PdfPTable)
Body (PdfPTable)
I am currently using writeSelectedRows to display Header1 and Header2, but document.add is used to display Body. The problem is the system is set to write the headers AFTER the body is already displayed on the screen, so I display my headers on top of my body's content. My question is, how do I add the body table (using document.add) and show it about halfway down the page (or whatever vertical position you specify)? This way I have enough room to display my headers above the body table.
Note. I believe the body table uses document.add to facilitate automatic paging if the body content is too large.
a source to share
Write your header tables at an absolute position at the top of the document, so the y position will look like this:
y = PageHeight - TableHeight;
Then add your body tables using document.add
here is an example i googled, Page header image generated by iTextSharp?
a source to share