I am trying to convert my html page to pdf format using mpdf. the problem is that I cannot apply more than one css to a pdf file .. here is my php code
<?php $html =file_get_contents('mpdf/test.html'); include("../mpdf.php"); $mpdf=new mPDF(); $mpdf->SetDisplayMode('fullpage','two'); // LOAD a stylesheet 1 $stylesheet = file_get_contents('assets/css/main.css'); $mpdf->WriteHTML($stylesheet,1); // The parameter 1 tells that this is css/style only and no body/html/text // LOAD a stylesheet 2 $stylesheetextra = file_get_contents('assets/css/test.css'); $mpdf->WriteHTML($stylesheetextra ,1); // The parameter 1 tells that this is css/style only and no body/html/text $mpdf->WriteHTML($html,2); $mpdf->Output(); exit; ?>
The output it gives does not come with test.css. main.css correctly applies to a pdf file, but test.css does not apply .please Help me? thank you in advance
source share