Closed tflori closed 5 years ago
Are you sure you're asking this in the right place? This here is not wkhtmltopdf
but the PHP wrapper. We can't implement features that wkhtmltopdf does not support. But maybe I don't understand what exactly you're asking for.
sorry, maybe it was somehow unclear described. in fact we are using another php wrapper for wkhtmltopdf but this is also missing this functionality (snappy).
at least in the wrapper we are using you can define the html $wrapper->loadHtml($html)
without creating a file and adding a page and so on. It would be nice to provide the header and footer the same way. $wrapper->addHeader($html)
without the need to create a file (temporary; because you don't have the html, you have a template engine that generates html) and adding the option --header-html /path/to/header.html
.
of course the same goes for the footer.
But you don't have to create files. Our class takes care of this. You can simply pass HTML for any header-*
or footer-*
option: https://github.com/mikehaertl/phpwkhtmltopdf#passing-strings
More precisely: We use a regex to find the options that expect a filename/URL and try to create a tmp file when possible (https://github.com/mikehaertl/phpwkhtmltopdf/blob/master/src/Pdf.php#L31).
oh wow. that's great! sorry for bothering :)
Why to have a cover when you can't add footer and header?
The difference between a page and a cover is that the footer and header are not visible on this page. It would be nice to have the footer and header options...
wkhtmltopdf --footer /path/to/footer.html --header /path/to/header.html /path/to/input.html /path/to/output.html