I’m trying to use dompdf but I keep getting the following errors…
[i]Strict Standards: require_once() [function.require-once]: It is not safe to rely on the system’s timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set()function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected ‘America/Chicago’ for ‘CDT/-5.0/DST’ instead in /home/farberam/public_html/BuilderApp/public_html/protected/extensions/pdf/dompdf/dompdf_config.inc.php on line 208
Warning: require_once(/home/farberam/public_html/BuilderApp/public_html/protected/extensions/pdf/dompdf/include/coutputprocessor.cls.php) [function.require-once]: failed to open stream: No such file or directory in /home/farberam/public_html/BuilderApp/public_html/protected/extensions/pdf/dompdf/dompdf_config.inc.php on line 208
Strict Standards: require_once() [function.require-once]: It is not safe to rely on the system’s timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected ‘America/Chicago’ for ‘CDT/-5.0/DST’ instead in /home/farberam/public_html/BuilderApp/public_html/protected/extensions/pdf/dompdf/dompdf_config.inc.php on line 208
Fatal error: require_once() [function.require]: Failed opening required ‘/home/farberam/public_html/BuilderApp/public_html/protected/extensions/pdf/dompdf/include/coutputprocessor.cls.php’ (include_path=’.:/home/farberam/public_html/BuilderApp/public_html/protected/extensions/pdf/dompdf:/home/farberam/public_html/BuilderApp/public_html/protected/extensions:/home/farberam/public_html/BuilderApp/public_html/protected/helpers:/home/farberam/public_html/BuilderApp/public_html/protected/components:/home/farberam/public_html/BuilderApp/public_html/protected/models:/usr/lib/php:/usr/local/lib/php’) in /home/farberam/public_html/BuilderApp/public_html/protected/extensions/pdf/dompdf/dompdf_config.inc.php on line 208
[/i]
I’m using DarkNSF’s example with only a couple of minor changes…
<?php
Yii::import('ext.pdf.dompdf.*');
require_once('dompdf_config.inc.php');
spl_autoload_unregister(array('YiiBase','autoload'));
spl_autoload_register('DOMPDF_autoload');
class Pdf
{
private $_dompdf;
private $_html;
/**
* Init
*/
public function __construct()
{
$this->_dompdf = new dompdf();
$this->_dompdf->base_path = Yii::app()->request->baseUrl;
}
/**
* set paper size
*
* @param string $size
* @param string $orientation
*/
public function setSize($size, $orientation='portrait')
{
$this->_dompdf->set_paper($size, $orientation);
}
public function renderPartial($view, $params)
{
$html = Yii::app()->controller->renderPartial($view, $params, true, true);
$this->_html .= $html;
}
public function stream($name)
{
$this->_dompdf->load_html($this->_html);
$this->_dompdf->render();
$this->_dompdf->stream($name);
}
}
and I call it from the following action in my controller…
public function actionPDF2($invID)
{
$inventory = $this->loadModel($invID);
$fileName = $inventory->communityPlan->community->name.'-Lot#'.$inventory->lotNumber;
$params = array('data'=>$inventory)
$pdf = new Pdf();
$pdf->renderPartial('pdfview', $params);
$pdf->stream($fileName);
}
Here is the function that contains line 208 that the errors are referring to…
function DOMPDF_autoload($class) {
$filename = mb_strtolower($class) . ".cls.php";
require_once(DOMPDF_INC_DIR . "/$filename");
}
Anyone have any ideas of what I’m doing wrong?
Thanks in advance!