I used an absolute URI for referencing the font file, but I get this error:
Failed to execute:
../../../bin/wkhtmltopdf-amd64 --margin-top 0 --margin-bottom 0 --margin-left 0 --margin-right 0 --orientation 'Portrait' --page-size 'A4' --dpi '300' -q - -
Error: PDF could not be generated!
Nothing of use for debugging. I can’t install the font locally because I’m on a shared host (meaning I can’t avoid using @font-face). When debugging, the html page renders just fine; when generating the PDF, I get the error. If I try and embed the font directly using base64 encoding, the font just doesn’t get applied (defaults to another font).
Further testing:
It is only when the @font-face rule is being applied that it fails without a reason. If I set the style media to be “print”, no errors – but no font either. When I set it to “all” and the font is either a) correctly referenced or b) input directly via base64 encoding – it fails.
Turns out it isn’t wkhtmltopdf’s fault – it’s webkit’s fault.
https://bugzilla.mozilla.org/show_bug.cgi?id=468568