I'm trying to generate a pdf file from an html / twig file.
When you write echo in the variable that contains the html, it is correctly formatted, but when you call DomPdf it gets lost, and can not find the classes, so the pdf is broken. Someone would have some solution to the problem and or some other lib alternative to the situation. Here's the code I'm trying to do.
echo $ file;
$pdf = new Dompdf();
$pdf->loadHtml($file);
$pdf->render();
$pdf->setBasePath($_SERVER['DOCUMENT_ROOT'] . '\css\boletos');
$pdf->stream($client->getCpf() . '.pdf'); aqui