Fix wkhtmltopdf headers clipping content?

wkhtmltopdf

Solution

I have learned that this is actually a known issue and is unlikely to be changed in a while. The workaround is to use `style="margin:0; padding:0;"` in the header `<body>` element. Another workaround would be to experiment with the `--header-spacing n` parameter. Yet another way is to wrap all top-page elements and add margin there, but that is a very bad an non-dynamic idea.

For for further information see:

http://code.google.com/p/wkhtmltopdf/issues/detail?id=182 (duplicate of this issue) http://code.google.com/p/wkhtmltopdf/issues/detail?id=175 (the origins of this issue) http://code.google.com/p/wkhtmltopdf/issues/detail?id=523 (header-spacing workaround)

Problem

My headers often clip content so that the content below it is not completely visible, it appears as though the page continues underneath the header before the header ends and as a result, not all of the content is shown. Is there a CSS rule I can use for this? Or a cmd argument for wkhtmltopdf? Or any other way?

Original source

Related problems