Squared characters issue on wkhtmltopdf

When I had the black squares issue I was able to solve it without installing X11 by installing the urw-fonts package.


I was able to solve this problem using the following resource:

http://code.google.com/p/wkhtmltopdf/wiki/static

In short, you probably don't need to install the entire x11 library and all its dependencies. Just installing urw-fonts should do the trick. The above resource even mentions CentOS as having this problem.

Run this command on your server:

sudo yum install urw-fonts libXext openssl-devel

In case someone faces the same issue on Alpine. This solved the problem for me:

apk --update add ttf-dejavu

I am using CentOS 7 with wkhtmltox 12.4 and found that none of the suggestions thus far fixed my block-text in output PDFs.

For me, the final solution was to install dejavu-sans-fonts.