Dompdf error "No block-level parent found. Not good."

Eliana picture Eliana · May 30, 2016 · Viewed 14.6k times · Source
require_once("function/dompdf/dompdf_config.inc.php");
$dompdf = new DOMPDF();
foreach($modules as $module){
   $output = "Hello " .$module['name'];
   $dompdf->load_html($output);
   $dompdf->render();
   $output_pdf = $dompdf->output();
   file_put_contents($dir . $name_modulo . ".pdf", $output_pdf);

}

Fatal error: Uncaught exception 'DOMPDF_Exception' with message 'No block-level parent found. Not good.'

Answer

Nimya V picture Nimya V · Jan 22, 2018

dompdf folder>dompdf_config.custom.inc.php file>try uncomment the line

define("DOMPDF_ENABLE_HTML5PARSER", true);

Also replace unsupported html5 tags & attributes with supported one,clear html errors for better result