創建兩個PDF時,我嘗試在同一時間它拋出錯誤創建兩個PDF ...DOMPDF,我不能在時間
Fatal error: Uncaught exception 'DOMPDF_Exception' with message 'No block-level parent found. Not good.' in C:\wamp\www\si2i\application\libraries\dompdf\include\inline_positioner.cls.php on line 38 (!) DOMPDF_Exception: No block-level parent found. Not good. in C:\wamp\www\si2i\application\libraries\dompdf\include\inline_positioner.cls.php on line 38
這裏是代碼:
$this->load->library('pdf');
$this->pdf->set_base_path($data['path']);
$this->pdf->load_view('adm/invoice/si2i',$data);
$this->pdf->render();
$output = $this->pdf->output();
file_put_contents("uploads/invoice/invoice_".$invoice_file_name.".pdf", $output);
$this->load->library('pdf');
$this->pdf->set_base_path($data['path']);
$this->pdf->load_view('adm/invoice/si2i',$data);
$this->pdf->render();
$output = $this->pdf->output();
file_put_contents("uploads/invoice/invoice_".$invoice_file_name.".pdf", $output);
請幫我出..
在此先感謝...
您使用的是什麼框架和庫/插件/附加組件?通常在重新使用之前重置dompdf變量是一個好主意。此外,該錯誤通常表明null內容被送到dompdf,你確定在這兩種情況下load_view方法正在工作嗎? – BrianS
我們正在使用codeigniter,感謝您的回覆......我已經解決了這個問題....我已經重新初始化了pdf庫,然後它開始工作......下面是代碼:$ pdf = new pdf(); $ pdf-> set_base_path($ data ['path']); $ pdf-> load_view('adm/invoice/si2i',$ data); $ pdf-> render(); $ pdf = new pdf(); $ pdf-> set_base_path($ data ['path']); $ pdf-> load_view('adm/invoice/si2i',$ data); $ pdf-> render(); – sangeethulugonda