WkHtmlToPdf Unreadable Fonts

1.3k views Asked by At

I installed wkhtmltopdf in a VPS/Centos . But it seems that it cannot find the fonts (I have all type1 and fonts-75dpi installed). In php, this is the result of

exec(wkhtmltopdf http://www.google.com test.pdf);

enter image description here

2

There are 2 answers

0
gdm On

This is the solution for Cento6

yum install libXext  libXrender  fontconfig  libfontconfig.so.1
yum install urw-fonts
0
Jurrian On

For if anyone interested, I solved my problems by installing true type fonts. After that wkhtmltopdf was able to display these fonts.

Ubuntu (18.04)

apt install fonts-droid-fallback ttf-dejavu fonts-freefont-ttf fonts-liberation ttf-ubuntu-font-family

Alpine Linux (3.9)

apk add ttf-dejavu ttf-droid ttf-freefont ttf-liberation ttf-ubuntu-font-family