我正在使用 TCPDF 库版本:5.9.011。我正在尝试将 HTML 布局作为 PDF 执行。我尝试通过示例提供该站点
$html = '<h1>HTML Example</h1>
<h2>List</h2>
Some special characters: < € € € & è è © > \\slash \\\\double-slash \\\\\\triple-slash
';
// output the HTML content
$pdf->writeHTML($html, true, false, true, false, '');
//Close and output PDF document
$pdf->Output('example_006.pdf', 'I');
显然发现生成的 PDF 仅默认页眉和页脚,中间内容为空白。
但是,如果我删除特殊字符,例如:
$html = '<h1>HTML Example</h1>
<h2>List</h2>
Some special characters:
';
PDF 获取其中指定的中间内容$html