使用带有unicode的xhtml2pdf时出现问题

use*_*616 1 pdf unicode hebrew pisa

我一直试图转换希伯来语html文件但没有成功; 不管我试过什么编码,希伯来字符在输出PDF中显示为黑色矩形.

我尝试了比萨发行版中包含的一些unicode测试文件:pisa-3.0.33\test\test-unicode-all.html\test-bidirectional-text.html.无论是否使用,我都从命令行运行xhtml2pdf --encoding utf-8.同样的结果:没有一个非拉丁字符通过.

这是字体问题*?如果unicode测试文件适合您,您有什么设置它吗?

*FWIW,至少其中一些语言,包括希伯来语,应该与Arial合作.

编辑:或者,如果有人设置了比萨并且可以尝试转换上面的unicode测试文件,我将非常感激.

小智 5

在html中插入以下代码对我有帮助

<style>
@page {
size: a4;
margin: 0.5cm;
}

@font-face {
font-family: "Verdana";
src: url("verdana.ttf");
}

html {
font-family: Verdana;
font-size: 11pt;
}

</style>
Run Code Online (Sandbox Code Playgroud)

在url而不是"verdana.ttf"中,你应该在你的操作系统中放置字体的绝对路径