我得到一个 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 文件适用于包括中文在内的所有语言。