I added a second site based on the linked Topic. This worked without any problem on first sight.
However the formatting of PDF’s created from a SINV and other documents (by clicking the PDF button on the print preview) does not work anymore. The entire Layout (Logo on Top, Layout of the print) is lost after clicking the PDF button.
The only workaround I can get running is to use PRINT (instead of PDF) from the Print Preview and save a pdf from there.
Any idea how to get around this misbehavior? I would suggest wkhtmltopdf being responsible for the translation to PDF but as I have not done anything to the codebase itself (and also it work going via PRINT leaves me puzzled to some extent.
No, I definitely understand the problem you’re having. I’ve had it too, and there are several threads about this issue on the forum.
There are a number of different things that can lead to this issue, but at core the problem is that wkhtmltopdf is not able to access your css file locally. It usually takes some troubleshooting to fix, but explicitly setting your domain is often one of the necessary steps. Updating your /etc/hosts file is also sometimes necessary.
Unfortunately, wkhtmltopdf is a fussy creature, and it’s created a challenge for many.
It should be host_name: "https://site.domain.com", but as @peterg pointed above, it could either be caused by hostname or by some other issue. Also, you don’t require ssl details in the config usually.
I recently started having trouble again, which seemed to be related to an older version of wkhtmltopdf (0.12.4). I upgraded (to 0.12.6), and it’s working again. It’s a fussy thing, and thankfully wkhtmltopdf is being replaced in v14, but for now that’s another thing worth trying.