wkhtmltopdf repeating thead headers overlapping content
I solved it with these three css rules: thead { display: table-header-group; } tfoot { display: table-row-group; } tr { page-break-inside: avoid; }
I solved it with these three css rules: thead { display: table-header-group; } tfoot { display: table-row-group; } tr { page-break-inside: avoid; }
wkhtmltopdf v 0.11.0 rc2 What ended up working: wkhtmltopdf –margin-top 0 –margin-bottom 0 –margin-left 0 –margin-right 0 <url> <output> shortens to wkhtmltopdf -T 0 -B 0 -L 0 -R 0 <url> <output> Using html from stdin (Note dash) echo “<h1>Testing Some Html</h2>” | wkhtmltopdf -T 0 -B 0 -L 0 -R 0 – <output> Using … Read more
Possibly unrelated as your pdf generated ok with an earlier version of wkhtmltopdf. Either way, I had similar issues with page breaks not being applied correctly. My problem was parent elements of the page-breaked element having an overflow other than visible. This fixed my issue: * { overflow: visible !important; } Of course, you can … Read more
Wkhtmltopdf does support even very complex headers and footers. wkhtmltopdf.exe -T 50mm –header-html www.google.com www.stackoverflow.com test.pdf && test.pdf That command uses the page at www.google.com as a 50mm header for www.stackoverflow.com for every page. Note: If you use a custom page for the header/footer, you need to add <!DOCTYPE HTML> in the beginning of your … Read more
This is caused by the change of default behavior in version 0.12.6 of wkhtmltopdf. wkhtmltopdf disables local file access by default now. It could be solved by adding the command line parameter –enable-local-file-access or the combination –disable-local-file-access –allow <path>
Update 17.09.2015: Check the version you are using: wkhtmltopdf 0.12.2.4 is said to fix the problem (I have not checked). This is a known issue in wkhtmltopdf. The page breaking algorithm used by webkit (the WK in WKhtmltopdf) doesn’t really work well for large tables. I suggest breaking the table down to smaller chunks that … Read more
or try this (from http://drupal.org/node/870058) Download wkhtmltopdf. Or better install it with a package manager: sudo apt-get install wkhtmltopdf Extract it and move it to /usr/local/bin/ Rename it to wkhtmltopdf so that now you have an executable at /usr/local/bin/wkhtmltopdf Set permissions: sudo chmod a+x /usr/local/bin/wkhtmltopdf Install required support packages. sudo apt-get install openssl build-essential xorg … Read more