2015-04-15 26 views
0

創建PDF我使用DOMPDF version (0.6 beta)。我是收到以下錯誤:錯誤而使用DOMPDF

Fatal error: Call to a member function append_child() on null in C:\xampp\htdocs\practice\application\helpers\dompdf\include\frame_tree.cls.php on line 220 

這裏是我的代碼片段:

$this->load->helper(array('dompdf', 'file')); 
$quoteId = $this->uri->segment('4'); 
$filename ='ship-'.uniqid().'.pdf'; 
$data = pdf_create($html, '', false); 

$html = file_get_contents(BASE_URL.'index.php/admin/quotes/createQuotePDF/'.$quoteId); 

我堅持這個錯誤在過去的4個小時。 無法從谷歌獲得太多。任何幫助,將不勝感激

+1

在你的代碼片段中,變量'$ html'的聲明在函數調用'pdf_create'之後。該聲明必須完成函數調用,否則該變量將保持未定義並導致錯誤。 –

回答

0

我意識到我犯了什麼錯誤。我包括太多的樣式,它不能處理。然後用最小的內聯樣式實現,它像一個魅力工作