"--encoding utf8 --page-size A4 -L 10 -R 10 --header-html "+Site.EnvironmentUrl+"BalansHeader.aspx --footer-html "+Site.EnvironmentUrl+"BalansFooter.aspx"
Hello all.
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: https://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: https://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]"
Hello everyone!
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..
Filipa Rebelo wrote:
Hi,
Even i am facing the same problem, but with footer. Were you able to solve the issue by any chance?
Thanks
Ranjith.S
Hi
Can anyone see why this won't work? I'm pretty sure I've had page numbering working using the WhereToAddPageNumbers argument, but this doesn't seem to work so I tried:
"-B 30mm --footer-center [page]/[toPage] --header-html " + Site.SiteURL + "OutputHeader.aspx?CaseId=" + CaseId
No footer - header is fine.
Help would be much appreciated!
Thanks, Trish
Try [page]/[toPage] --> [page]/[topage]
kobe Liu wrote:
I'm afraid no luck - but thank you
Trish Tye wrote:
Hello Trish,
Which version of the binaries are you using? I had the same problem, downloaded and uploaded the 12.3.2 one and its working now : )
Best regards
Cristiano Marques wrote:
We're using 12.4.
It's weird as I had it working and then I think I've done something to the design of the page that is preventing it from working. Can't figure it out!
Thanks for suggesting this though
Trish