"--encoding utf8 --page-size A4 -L 10 -R 10 --header-html "+Site.EnvironmentUrl+"BalansHeader.aspx --footer-html "+Site.EnvironmentUrl+"BalansFooter.aspx"
Advice: Check the wkhtmltopdf.exe version which you are using. Also, the OS version (using Windows 10, for instance) might have impact.
Recently I have been struggling with. Cannot seem to get Header and Footer to work...
Turns out it has to do with the wkhtmltopdf tool it self.
Version: "wkhtmltopdf 0.12.3.2 (with patched qt)"
Result: Header and footer works.
Version: "wkhtmltopdf 0.13.0-alpha-7b36694" (which is the Windows (MinGW-w64) and the only one that can be used in a cloud environment (Personal or Enterprise) as indicated in the FAQ of Html2PdfConverter. Link: http://www.outsystems.com/forums/discussion/17923/html2pdfconverter-faq/)
Result: Header and footer DON'T work!
Running "wkhtmltopdf.exe -V" in a command line in Windows 10:
Qt: Untested Windows version 10.0 detected!wkhtmltopdf 0.13.0-alpha-7b36694
Alpha version of wkhtmltopdf is not finished and it currently does not support header and footer (post date 2016-04-29): https://github.com/wkhtmltopdf/wkhtmltopdf/issues/2916
Version 0.12.2.4 (the most recent, stable, with MinGW) has Header and Footer working.
You can download it from this link in the official wkhtmltopdf downloads page: http://download.gna.org/wkhtmltopdf/0.12/0.12.2.4/
I used "wkhtmltox-0.12.2.4_mingw-w64-cross-win64.exe" (64 bit), extracted/installed, and then install/uploaded in my personal cloud environment, and it is working, for example with the following extra arguments:
--footer-line --footer-center "Hello World! [page]/[topage]"
I'm using the latest version of wkhtmltox and I still have problems with the header. Sometimes generates the pdf with the header in only one random page, other times it doesn't show the header at all..