Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

html to pdf with wkhtmltopdf

The html is pretty simple with just an image and an absolutely positioned div. The pdf looks good, the layout is perfect and the resolution too but there's one extra blank page.

I tried these two commands and I get the same result:

wkhtmltopdf --page-width 11 --page-height 8.5 -O Landscape file.html file.pdf
wkhtmltopdf -s Letter -O Landscape file.html file.pdf

How can I get rid of the blank page?

like image 769
elclanrs Avatar asked Mar 30 '11 00:03

elclanrs


2 Answers

I fixed it by using position: absolute on the image too. z-index values work as expected.

like image 71
elclanrs Avatar answered Nov 15 '22 13:11

elclanrs


Check once more your css for extra div which set the height property .

like image 36
gdm Avatar answered Nov 15 '22 13:11

gdm