我正在获取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文件非常适合所有语言,包括中文。