tags:

views:

1191

answers:

2

I am developing a report generation application that could have tabular data across multiple pages. I am using pdfTable to create tabular data. I am issues with adding page headers. The problem is that when I add page header onEndPage event handler, I am not get the table to start after certain gap so that header is visible.

A: 

If you are using tables (PDFPTable) for your layout then you can use: table.setHeaderRows(2);

http://www.1t3xt.info/api/com/lowagie/text/pdf/PdfPTable.html

+1  A: 

If I understand this correctly, you just need to change your margins, so table will start after header.

From http://www.docjar.org/docs/api/com/lowagie/text/Document.html

public Document(Rectangle pageSize,
float marginLeft,
float marginRight,
float marginTop,
float marginBottom)

For example:

final Document document = new Document(PageSize.A4, 50, 50, 165, 50);
GvS
This should do the trick. I've used the same idea before.
thedude19