Dompdf错误“未找到块级父级。不好。” [英] Dompdf error "No block-level parent found. Not good."

查看:94
本文介绍了Dompdf错误“未找到块级父级。不好。”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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);

}




致命错误:未捕获的异常消息为 DOMPDF_Exception,消息为未找到块级父。不好。'

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


推荐答案

dompdf 文件夹> dompdf_config.custom.inc.php file>尝试取消注释

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

define( DOMPDF_ENABLE_HTML5PARSER,true);

define("DOMPDF_ENABLE_HTML5PARSER", true);

也可以替换不受支持的html5标签和支持的属性,清除html错误以获得更好的结果

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

这篇关于Dompdf错误“未找到块级父级。不好。”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆