wkhtmltopdf footer-html encoding utf-8

被刻印的时光 ゝ 提交于 2019-12-03 15:48:37

问题


wkhtmltopdf --encoding utf-8 is not working for --footer-html.

I am using the following command. Both HTML files are also in utf8 format.

wkhtmltopdf  --dpi 120 -O Portrait --encoding 'utf-8' --footer-html /tmp/testFooter.html  /tmp/testMain.html  /tmp/testPDF.pdf

Both files have french characters. But in pdf footer have bad characters.

<html>
     <head>
        <title></title>
     </head>
    <body>
    <div style="width:95%;font-size:9pt;font-family:Arial;">
    <div style="border-top: 1px solid black;width: 100%;text-align: center;">
    test - Guérin 691BANNE - FRANCE - SA au capital 0 Euros -737 729 - Téléphone :  86 03</div></div>
    </body>
</html>

Following image is output


回答1:


Try adding the following line in the HTML head element of the footer:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">



回答2:


Make sure you have specific font installed there. I need Hindi (Indian Language) on my PDF files. putting meta tag had not solved my problem. So i installed hindi fonts on my debian box by

sudo apt-get install fonts-indic


来源:https://stackoverflow.com/questions/21455779/wkhtmltopdf-footer-html-encoding-utf-8

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!