我试图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