wkhtmltopdf footer-html编码utf-8 [英] wkhtmltopdf footer-html encoding utf-8

查看:445
本文介绍了wkhtmltopdf footer-html编码utf-8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

wkhtmltopdf --encoding utf-8不适用于--footer-html.

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

我正在使用以下命令.这两个HTML文件也都是utf8格式.

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

两个文件均具有法语字符.但是在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>

输出以下图像

推荐答案

尝试在页脚的HTML head元素中添加以下行:

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

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

这篇关于wkhtmltopdf footer-html编码utf-8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆