Search code examples
phptextwkhtmltopdf

Poor text quality using wkhtmltopdf


I am generating PDF with WKHTMLTOPDF library in PHP project (https://github.com/mikehaertl/phpwkhtmltopdf)

When I generate invoices(PDF) on my local comnputer it is in good quality enter image description here

but when I generate it on production server, it gives me this quality enter image description here

The options are same (it is same project with same conf). What is the reason for this behavior?


Solution

  • Complete solution is to install Microsoft fonts on server.

    1. aptitude install ttf-mscorefonts-installer
    2. fc-cache -fv
    3. dpkg-reconfigure fontconfig-config (native, automatic, no)
    4. dpkg-reconfigure fontconfig
    5. restart php-fpm