1
For a few days now I’m trying to generate a PDF report with PHP, I found several examples on the internet and all gives the same error, below I put the example code and the error print.
My Xampp server, is using PHP version 7 and the library to generate 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:
Several libraries generate this error. If anyone can suggest another option. My project is simple does not use any framework.
Thank you very much Everson for editing my question, improved a lot. But as for my question, you can help me?
– PauloGalego
Why did you comment on the attribution in the $css variable?
– Felipe
I commented to see if that was what was generating some error. You killed the riddle, that was what was generating the error. Thank you very much
– PauloGalego
If the error stopped appearing , mark as answered your question , to facilitate the search for the solution of others who are with the same doubt.
– Felipe