wkhtmltopdf and chinese characters

后端 未结 2 905
逝去的感伤
逝去的感伤 2021-01-13 01:20

Trying to generate a PDF with wkhtmltopdf but it gives me a lot of trouble displaying all the characters.

Some of characters work - e.g. when printing

相关标签:
2条回答
  • 2021-01-13 01:55

    Did you install the Chinese, Japanese, and Korean Fonts that are mentioned in the Ubuntu Community Help Wiki?

    0 讨论(0)
  • 2021-01-13 02:03

    Looking at the PDF generated on another System in detail, you can find out which font is used by wkhtmltopdf on that system and then locate the proper substitute. Dalibror Nasevic did the work for a large subset of asian fonts and described what he had to install on a CentOS (RedHat) based system:

    Figuring out missing fonts for wkHTMLtoPDF

    On a headless Debian-stretch-based system, according to Dalibror Nasevic I had to add fonts-droid-fallback, fonts-wqy-microhei and fonts-wqy-zenhei

    In addition, following the recommendations from the Ubuntu Community Help Wiki, fonts-dejima-mincho, fonts-nanum-coding, fonts-takao, fonts-takao-gothic, fonts-takao-mincho might be worth giving a try.

    0 讨论(0)
提交回复
热议问题