CSS Border mpdf输出

时间:2015-10-27 19:56:53

标签: css pdf mpdf

以下是正在发生的事情。发生了什么我使用mpdf作为输出,由于某种原因我不能让css输出工作。

这是css代码:
    td colspan =“2”style =“border-bottom:2px dashed#000;”

有没有办法将css用于PDF输出?

谢谢你, 凯文戴维斯

1 个答案:

答案 0 :(得分:1)

$mpdf=new mPDF();
$html = "<H1>Hello World</H1>";
$stylesheet = file_get_contents('style.css');  
$mpdf->WriteHTML($stylesheet,1);    // The parameter 1 tells that this is css/style only and no body/html/text
$mpdf->WriteHTML($html,2);
$mpdf->Output();
exit;