Forums

Problem with font when using wkhtmltopdf

On my personal server, I was able to use

* {
    font-family: Verdana;
}

just fine, however this did not work on the Pythonanywhere server. So I tried:

*, html *, body * {

    font-family: Verdana !important;
}

That still didn't work. Has anyone else experienced this problem with wkhtmltopdf on pythonanywhere? Any ideas on how to solve it?

You're trying to use a font that is not installed on PythonAnywhere. See https://help.pythonanywhere.com/pages/Fonts/ for how to install fonts. There may be additional steps that you need to do to make the font available to wkhtmtopdf - check the wkhtmltopdf docs to see if that's the case.

I also found the same issue I couldn't use google fonts but it works on my machine

That sounds like an issue related to using a free account; free accounts can only access specific external Internet sites, and it's likely that the host used for those fonts is not on the list of allowed sites. If you let us know what it is, we can look into adding it to the allowlist.

You are absolutely correct giles It works on our enterprise project thanks a lot

No problem, glad to help!