I am trying to convert html into pdf using mpdf. Problem is that i am unable to apply css to pdf file..
Here is my code of php:
<?php
$html = $divPrint;
$mpdf=new mPDF();
$stylesheet = file_get_contents('pdf.css');
$mpdf->WriteHTML($stylesheet,1);
$mpdf->WriteHTML($html,2);
$mpdf->Output();
exit;
?>
What it is doing is taking html through ajax on my this php page. But the output it gives doesn't come with css which i've written for it..
Please tell me that to do now?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…