I have a couple of problems with wkhtmltopdf. I am using wkhtmltopdf 0.12.2 (with patched qt)
I am converting a custom html page to a PDF. The rendered html looks correct on the browser, fonts rendered correctly, border-radius working fine. All that I expected.
When I run the wkhtmltopdf program with the rendered html page as input, some of the styling is rendered but the fonts are not.
I am using a custom font called Brandon Grotesque. I have tried importing it a myriad of ways
- Serving it locally on my site
- Using base64 encoding
- Installing the font locally on the machine
- I also tried importing the file from AWS S3 at one point :)
Here are the screenshots of the problem This is the screenshot of the rendered HTML page that will serve as input
This is the screenshot of the PDF output
Lastly, this is the command that I am using to get the results
xvfb-run --server-args="-screen 0, 1024x768x24" wkhtmltopdf --encoding 'utf-8' --print-media-type --page-width 5in --page-height 7in -B 20 -L 5 -R 5 -T 5 --footer-html http://localhost:6116/packing_slip/footer http://localhost:6116/packing_slip/render?<some_query_string> /tmp/packing_slips/32345447_BEWZy_.pdf
Any input would be helpful.