How can I repeat the headings of a PdfPTable
in all the pages if the length of the table exceeds one page?
To repeat the PdfGrid headers in all the pages of PDF document, we can add the headers using PdfGridHeaderCollection class and enable the RepeatHeader property to repeat header in grid table.
In order to add text in the footer, you need to create a Document object and a TextStamp object using required properties. After that, you can call AddStamp method of the Page to add the text in the footer of the PDF. The following code snippet shows you how to add text in the footer of a PDF file with Java.
Look at setHeaderRows(int headerRows)
of PdfPTable
. Rows defined there as a header should persist on new pages.
table.setHeaderRows(1)
for the first row as a header.
See the API.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With