Yap, the first thing I did. They just mention Headers and footers can also be supplied with HTML documents. As an example one could specify --header-html header.html, which is what I’ve tried to do, I think.
I think it can either be an URL or the html template file. I’ve tried with the google URL as well, but still no luck. I wonder if it’s a problem with the elixir-pdf-generator library.
Thanks for the input!
Did it work for you? Curiously, I got the exact same result, just the body being rendered
I’m running this code inside docker so I’m passing the no_sandbox: true flag and using generate_binary! followed by writing to a file, but I don’t think that should be why the header keeps being ignored.
Ok, so it seems like it’s a problem with wkhtmltopdf on my side. I’m currently running on version 0.12.5 but without the patched QT, which is the reason why it doesn’t work!! I’m running inside docker with alpine, so wkhtmltopdf is installed with a Dockerfile through RUN apk add wkhtmltopdf. Do you know if there’s a way to specify that I wan’t the QT patched version, or is it not available yet like this?
Unfortunately not, the only two available options are:
wkhtmltopdf 0.12.5 from v3.12,
wkhtmltopdf 0.12.6 from edge.
But they don’t include the desired patch. I think that you have to build this manually in your Dockerfile (preferably as an independent layer) and later copy it to your final image. I have never used this tool before so I can’t help you much with this.