Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flying Saucer xhtml to pdf header margins on every page

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

like image 803
Philipp Schemel Avatar asked Dec 02 '13 10:12

Philipp Schemel


1 Answers

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.

like image 108
Philipp Schemel Avatar answered Oct 20 '22 08:10

Philipp Schemel