PDF在打开HTML文件时不支持中文

时间:2012-12-07 04:31:11

标签: php html pdf character-encoding

我正在获取HTML文件并以PDF格式打开它。它适用于en,cz,pl,ru语言,但对于中文,它不显示字符,而是显示框。请看图片。我的代码是:

header("Cache-Control: no-cache");
header("Content-Description: File Transfer");
header("Content-Disposition: attachment; filename=$html_file.pdf");
header("Content-Type: application/pdf");
header("Content-Transfer-Encoding: UTF-8");

在$ html_file中我正在使用:

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

HTML文件非常适合所有语言,包括中文。

enter image description here

0 个答案:

没有答案