Error generating PDF report with mpdf60

0

For a few days I've been trying to generate a PDF report with PHP, I found several examples on the internet and everyone gives the same error, I've put the sample code and error print below.

My Xampp server is using PHP version 7 and the library to generate the PDF is mpdf60.

<?php 
 include("mpdf60/mpdf.php");

 $html = "
 <fieldset>
 <h1>Teste de relatório</h1>
 <div class='creditos'>
 <p>Relatório pdf</p>
 </div>
 ";

 $mpdf=new mPDF(); 
 $mpdf->SetDisplayMode('fullpage');
// $css = file_get_contents("css/estilo.css");
 $mpdf->WriteHTML($css,1);
 $mpdf->WriteHTML($html);
 $mpdf->Output();

 exit;

 ?>

See the error output:

Multiple libraries generate this error. If anyone can suggest another option. My project is simple does not use any framework.

    
asked by anonymous 05.04.2018 / 18:21

1 answer

1

Uncomment the $ css variable

 $mpdf=new mPDF(); 
 $mpdf->SetDisplayMode('fullpage');
 $css = file_get_contents("css/estilo.css");
 $mpdf->WriteHTML($css,1);
 $mpdf->WriteHTML($html);
 $mpdf->Output();
    
05.04.2018 / 19:00