Flying Saucer xhtml to pdf header margins on every page

4.6k views Asked by At

Im still working with flying saucer to export xhtml to pdf.

At the moment its just a datatable with header and footer on every page.

The problem is, the header on the second page (and also on the following ones) has no margins, so the header underlays the content of the datatable, because the table is too large for one page.

Ive tried a lot, but nothing works.

The margins are set with css style in the body tag.

Hope somebody can help me as far.

Greetings

1

There are 1 answers

0
Philipp Schemel On BEST ANSWER

Solved it to my own:

Just added

@page { margin: 100px 50px 50px}

to the styles.

The table had a very bad looking break after a page, so I added also this:

tr{page-break-inside:avoid;}

Now it works fine.