1
我试图在mpdfstyletables.css
文件中添加css,但无法添加新的css。 PHP代码:尝试在mpdf中添加css。但不能接受
<?php
$html = utf8_decode($html);
$html = iconv("UTF-8","UTF-8//IGNORE",$html);
include("./MPDF/mpdf.php");
$tpdf=new mPDF('c','A4','','',32,25,27,25,16,13);
$tpdf->ignore_invalid_utf8 = true;
$stylesheet = file_get_contents('mpdfstyletables.css');
$tpdf->WriteHTML($stylesheet,1);
$tpdf->WriteHTML($html,2);
$tpdf->Output($fname,'I');
exit();
?>
我曾尝试this但对我不起作用。
如何添加css。我感谢所有回应。感谢未来。
什么是在CSS文件?您发布的代码应该正常工作。 – Finwe
不会失败,因为你写这个没有标签的HTML? –