Reputation: 23
I'm trying to integrate DOMPDF to our Joomla (Version 1.5.24) project and I keep getting these errors:
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
The function that instantiates the DOMPDF object is located in one of the views of the component:
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");
}
}
It sees the file that is required but dompdf_config.inc.php outputs errors described above. I'm not sure what is causing this since the file only contains define
lines and an autoload
function. The content of the file can be seen here: http://code.google.com/p/dompdf/source/browse/trunk/dompdf/dompdf_config.inc.php.
Please help! Thanks!
Upvotes: 0
Views: 2359
Reputation: 1680
all those strict standard warnings you are getting is becuase of this line
error_reporting(E_STRICT | E_ALL);
in dompdf_config.inc.php
and you should include dompdf/include/dompdf.cls.php
Upvotes: 1