我試圖DOMPDF集成到我們的Joomla(版本1.5.24)的項目,我不斷收到這些錯誤:Joomla和DOMPDF集成錯誤
Strict standards: Non-static method JLoader::load() should not be called statically in C:\xampp\htdocs\proj\libraries\loader.php on line 162
Strict standards: Non-static method JLoader::register() should not be called statically in C:\xampp\htdocs\proj\libraries\loader.php on line 139
Fatal error: Class 'DOMPDF' not found in C:\xampp\htdocs\proj\components\com_reports\views\details\view.pdf.php on line 23
Strict standards: Non-static method JFactory::getDBO() should not be called statically, assuming $this from incompatible context in C:\xampp\htdocs\oasis\libraries\joomla\session\storage\database.php on line 84
Strict standards: Non-static method JTable::getInstance() should not be called statically, assuming $this from incompatible context in C:\xampp\htdocs\oasis\libraries\joomla\session\storage\database.php on line 89
Strict standards: Non-static method JFactory::getDBO() should not be called statically, assuming $this from incompatible context in C:\xampp\htdocs\oasis\libraries\joomla\database\table.php on line 112
來實例化對象DOMPDF的函數位於一個的視圖組件的:
class ReportsViewDetails extends JView{
function display($tpl = null){
global $mainframe;
//echo "hello";
$this->generatePDF();
}
function generatePDF(){
require_once("./components/com_reports/helper/dompdf/dompdf_config.inc.php");
$html =
'<html><body>'.
'<p>Put your html here, or generate it with your favourite '.
'templating system.</p>'.
'</body></html>';
$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->render();
$dompdf->stream("sample.pdf");
}
}
它把所需文件,但上述錯誤dompdf_config.inc.php輸出。我不確定是什麼導致這種情況,因爲該文件只包含define
行和autoload
函數。該文件的內容可以在這裏看到:http://code.google.com/p/dompdf/source/browse/trunk/dompdf/dompdf_config.inc.php。
請幫忙!謝謝!
如果你們對HTML,PDF工具,更容易使用任何建議,那麼請我的客人,併發布它。到目前爲止,我已經使用FPDF嘗試了HTML2FPDF,並且它不符合我的要求(需要爲每個生成的頁面顯示標題,但不知何故,生成的HTML結果不會自動將其自身定位在第二頁和下面的標題後面。解決這個問題,也請分享一下:D) – spicefoo 2012-01-03 11:15:54
這個錯誤說明它全部找不到DOMPDF類,爲什麼包含路徑到配置文件?不應該爲實際實現此類的文件創建路徑嗎? – Kishore 2012-01-03 11:20:37
根據我在配置文件中的理解,它包含了實現DOMPDF類的文件。我認爲這就是他們實施的方式。 – spicefoo 2012-01-03 11:25:19