【问题标题】:Getting Error "foo" from DOMPDF从 DOMPDF 获取错误“foo”
【发布时间】:2015-01-23 11:10:19
【问题描述】:

我有一个生成多个报告的脚本,我一直在使用 DOMPDF 将每个报告转换为 pdf。报告的大小和内容类型各不相同,但通常包含图像、表格和风格化文本。

在我尝试转换的最新报告中,出现以下错误:

Exception information:
Message: foo
Stack trace:
#0 library/dompdf/include/table_row_frame_reflower.cls.php(83): Cellmap->get_frame_height(Object(Table_Row_Frame_Decorator))
#1 library/dompdf/include/frame_decorator.cls.php(477): Table_Row_Frame_Reflower->reflow(NULL)
#2 library/dompdf/include/table_frame_reflower.cls.php(481): Frame_Decorator->reflow()
#3 library/dompdf/include/frame_decorator.cls.php(477): Table_Frame_Reflower->reflow(Object(Block_Frame_Decorator))
#4 library/dompdf/include/block_frame_reflower.cls.php(706): Frame_Decorator->reflow(Object(Block_Frame_Decorator))
#5 library/dompdf/include/frame_decorator.cls.php(477): Block_Frame_Reflower->reflow(Object(Block_Frame_Decorator))
#6 library/dompdf/include/inline_frame_reflower.cls.php(96): Frame_Decorator->reflow(Object(Block_Frame_Decorator))
#7 library/dompdf/include/frame_decorator.cls.php(477): Inline_Frame_Reflower->reflow(Object(Block_Frame_Decorator))
#8 library/dompdf/include/block_frame_reflower.cls.php(706): Frame_Decorator->reflow(Object(Block_Frame_Decorator))
#9 library/dompdf/include/frame_decorator.cls.php(477): Block_Frame_Reflower->reflow(Object(Block_Frame_Decorator))
#10 library/dompdf/include/block_frame_reflower.cls.php(706): Frame_Decorator->reflow(Object(Block_Frame_Decorator))
#11 library/dompdf/include/frame_decorator.cls.php(477): Block_Frame_Reflower->reflow(Object(Block_Frame_Decorator))
#12 library/dompdf/include/block_frame_reflower.cls.php(706): Frame_Decorator->reflow(Object(Block_Frame_Decorator))
#13 library/dompdf/include/frame_decorator.cls.php(477): Block_Frame_Reflower->reflow(NULL)
#14 library/dompdf/include/page_frame_reflower.cls.php(169): Frame_Decorator->reflow()
#15 library/dompdf/include/frame_decorator.cls.php(477): Page_Frame_Reflower->reflow(NULL)
#16 library/dompdf/include/dompdf.cls.php(680): Frame_Decorator->reflow()
#17 application/controllers/NetworthController.php(332): DOMPDF->render()
#18 library/ZendFramework-1.11.0/ZendFramework-1.11.0/library/Zend/Controller/Action.php(513): NetworthController->reportAction()
#19 library/ZendFramework-1.11.0/ZendFramework-1.11.0/library/Zend/Controller/Dispatcher/Standard.php(295): Zend_Controller_Action->dispatch('reportAction')
#20 library/ZendFramework-1.11.0/ZendFramework-1.11.0/library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#21 library/ZendFramework-1.11.0/ZendFramework-1.11.0/library/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front->dispatch()
#22 library/ZendFramework-1.11.0/ZendFramework-1.11.0/library/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
#23 index.php(150): Zend_Application->run()
#24 {main}  

我通过验证器运行输入到 DOMPDF 的 html,并且没有错误或警告。该报告确实包含多个表格,但没有一个表格会被强制拆分为多个页面(最长的表格约为一页的三分之一)。除了无效的 HTML 之外,我不确定是什么原因造成的,搜索此错误仅表明这是一个潜在原因。

建议?

【问题讨论】:

    标签: php zend-framework dompdf


    【解决方案1】:

    我阅读了这篇文章 https://groups.google.com/forum/?fromgroups#!topic/dompdf/yXDoankutY8 并开始挖掘 HTML 错误。

    检查您的 CSS 和 HTML 是否都经过验证。我使用 Tidy 函数修复了我的 HTML 并删除了我的 CSS,一点一点地重新实现它。

    在我的例子中,这是一个简单的 CSS 规则:

    .views-row {
      display: block;
    }
    

    【讨论】:

      猜你喜欢
      • 2021-01-21
      • 2018-12-10
      • 2021-10-01
      • 1970-01-01
      • 1970-01-01
      • 2015-07-20
      • 2014-02-22
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多