I have form.php file that getting data from mysql table.
form.php
if(mysql_num_rows($sql)==0){
?>
1.
America
Export as PDF
} else {
?>
1.
India
Export as PDF
}
?>
And pdf.php
require_once("dompdf/dompdf_config.inc.php");
ob_start();
$html = file_get_contents('form.php');
$dompdf = new DOMPDF();
date_default_timezone_set('Asia/Kolkata');
$tym = date('g:i s');
$filename = 'FAA-8130_3_'.$tym;
$dompdf->load_html($html);
ob_end_flush();
$dompdf->render();
$dompdf->stream($filename. ".pdf", array("Attachment" => 0));
When I try to export it as PDF file, it is giving error...
Fatal error: Call to a member function prepend_child() on a non-object in C:\wamp\www\path\to\dompdf\include\frame_tree.cls.php on line 231
I could not understand why it is happening. I viewed this,this and this, but failed to resolve.
No comments:
Post a Comment