doujiepin5547 2013-07-03 08:37
浏览 84

dompdf codeigniter,我试图渲染两个htmls我得到渲染错误

dompdf codeigniter , i am trying to render two htmls i get error on render

here the error that happens when i run the second render

[Wed Jul 03 09:18:10 2013] [error] [client 127.0.0.1] PHP Fatal error:  Uncaught exception 'DOMPDF_Exception' with message 'No block-level parent found.  Not good.' in /var/www/onplans/application/libraries/dompdf/include/inline_positioner.cls.php:38
Stack trace:
#0 /var/www/onplans/application/libraries/dompdf/include/frame_decorator.cls.php(546): Inline_Positioner->position()
#1 /var/www/onplans/application/libraries/dompdf/include/inline_frame_reflower.cls.php(37): Frame_Decorator->position()
#2 /var/www/onplans/application/libraries/dompdf/include/frame_decorator.cls.php(556): Inline_Frame_Reflower->reflow(NULL)
#3 /var/www/onplans/application/libraries/dompdf/include/page_frame_reflower.cls.php(138): Frame_Decorator->reflow()
#4 /var/www/onplans/application/libraries/dompdf/include/frame_decorator.cls.php(556): Page_Frame_Reflower->reflow(NULL)
#5 /var/www/onplans/application/libraries/dompdf/include/dompdf.cls.php(817): Frame_Decorator->reflow()
#6 /var/www/onplans/application/controllers/timeline.php(957): DOMPDF->render()
#7 [internal function]: Timeline->generate_report_ in /var/www/onplans/application/libraries/dompdf/include/inline_positioner.cls.php on line 38, referer:


if ( $reportCouvs[0] == 1 ) { 
    //  $this->pdf->load_html( 'reports/report_comb_1', $Ddata );
    $this->pdf->load_view( 'reports/report_comb_1', $Ddata );
    $this->pdf->render();
    $pdfoutput = $this->pdf->output();
    $filename = "$report_dir/"."cover3.pdf";
    $fp = fopen( $filename, "a" );
    fwrite( $fp, $pdfoutput );
    fclose( $fp );
    $this->pdf->load_view( 'reports/report_comb_2', $Ddata );
    $this->pdf->render();
    $pdfoutputu = $this->pdf->output();
    $filenameu = "$report_dir/"."imagleft3.pdf";
    $fp = fopen( $filenameu, "a" );
    fwrite( $fp, $pdfoutputu);
    fclose( $fp );

} else if( $reportCouvs[0] == 2 ) {
    $this->pdf->load_view('reports/report_comb_2', $Ddata ); 
}

on the second render the app crashes

is it possible to render two files with dompdf

  • 写回答

1条回答 默认 最新

  • dongsi2317 2013-07-30 04:26
    关注

    I have come up against this issue also. This error can happen for a few reasons. There are three options you can check:

    • reinstalling your DOMPDF library
    • make sure mbstring is installed/configured/enabled for PHP
    • make sure you are re-initialising, or creating a new instance of DOMPDF when looping.

    As it sounds like you have already output one PDF successfully, this indicates the first two options are likely not the issue. We can't see your complete code that relates to the issue, but it seems probable it is the third option.

    If it is the third, then you would make sure the loop that creates the pdfs started with the line:

    $this->pdf = new DOMPDF();
    
    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度