http://www.html2pdf.fr/en からスクリプトをダウンロードしてセットアップしました。デフォルトのエンコーディングでは正常に動作しますが、CP-1251 で文字を含むドキュメントを生成しようとすると、文字の代わりに空白が表示されます。また、CP-1251のすべてのファイル、CP-1251のベースのデータ、およびご覧のとおり、単純なフォント-Arialを使用しています
それを機能させるための解決策が存在するかもしれません。
P / s私の英語でごめんなさい
ob_start();
include(dirname(__FILE__).'/res/exemple00.php');
$content = ob_get_clean();
require_once(dirname(__FILE__).'/../html2pdf.class.php');
try
{
$html2pdf = new HTML2PDF('P','A4','fr');
$html2pdf->setDefaultFont('Arial');
$html2pdf->writeHTML($content, isset($_GET['vuehtml']));
$content1=$html2pdf->Output('', 'S');
// いくつかの php コード
$db->query("set names cp1251");
$query="SELECT data from files Where id=$file_id ";
$result=$db->query($query);
$row=$result->fetch_assoc();
$content=($row['data']);
header('Content-Type: アプリケーション/pdf');
header("Content-Length: ".strlen(コンテンツ));
header('Content-Disposition: attachment; filename=Invoice#'.$invoice_id.'.pdf');
$コンテンツを印刷します。
}
catch(HTML2PDF_exception $e) { echo $e; } enter code here