hello ... i tried dompdf to convert a php code to pdf. But when it encounters the tables in php it gives error.
Fatal error: Call to undefined method Inline_Frame_Decorator::normalise() in C:\wamp\www\include\table_frame_decorator.cls.php on line 252
CAn anyone please guide me why i am getting this error.. Here is my code
<?php
include('dompdf_config.inc.php');
global $_dompdf_show_warnings;
global $_dompdf_debug;
global $_DOMPDF_DEBUG_TYPES;
$outfile = 'test.pdf';
$save_file = TRUE; // Save the file or not
$buff = file_get_contents('task.php');
$dompdf = new DOMPDF();
$base_path = $_SERVER['DOCUMENT_ROOT'];
$dompdf->load_html($buff);
if ( isset($base_path) ) {
$dompdf->set_base_path($base_path);
}
$dompdf->render();
file_put_contents($outfile, $dompdf->output( array("compress" => 0) ));
if (!headers_sent() )
$dompdf->stream($outfile);
?>
and here is code for task.php
<?php
error_reporting(E_ALL);
mysql_connect("localhost","root","root");
$db=mysql_select_db("reportinfo");
$str="SELECT report_id FROM report WHERE report_id='1'";
$v=mysql_query($str) or die('Error'.mysql_error());
$s=mysql_fetch_array($v);
mysql_num_rows($v);
$st="SELECT * FROM section WHERE report_id ='".$s[0]."' ORDER BY position";
$res=mysql_query($st) or die('Error'.mysql_error());
echo "<br/>";
mysql_num_rows($res);
$ans="SELECT user_name FROM report WHERE report_id='1'";
$ansr=mysql_query($ans);
$r=mysql_fetch_array($ansr);
echo "<div align=\"center\">";
echo "<B>WELCOME </B>".$r[0]. "<B>   TO YOUR REPORT</B>";
echo "</div>";
echo "<br/>";
$kr=0;
while ($kr<mysql_num_rows($res))
{
$result=mysql_fetch_array($res);
echo "<div align=\"center\">";
echo $result['content'];
echo "</div>";
echo "<br/>";
$kr++;
}
print ("<form Name=\"theform\">");
print ("<input type=\"submit\" name=\"submit\"value=\"Convert to PDF\"onClick=\"submitfunction(1)\"/>");
print ("</form>")
?>
<SCRIPT>
function submitfunction(i)
{
if(i==1)
document.theform.action="sample.php";
document.theform.submit
}
</SCRIPT>