I am using dompdf library to output some reports. I got a file outputing but I am having some strange behavior. How do I enable debug reporting in dompdf?
$dompdf = new Dompdf();
// something like this
$dompdf->enableDebug();
$dompdf->loadHtml($template);
$dompdf->setBasePath(realpath('./'));
$dompdf->render();
$dompdf->stream('note');
Set up the globals like BrianS says:
global $_dompdf_warnings;
$_dompdf_warnings = array();
global $_dompdf_show_warnings;
$_dompdf_show_warnings = true;
Then, instead of streaming the pdf to the browser, dump the warnings array:
header('Content-type: text/plain');
var_dump($_dompdf_warnings);
die();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With