[eluser]kishore[/eluser]
Hi All,
I am a new bie to dompdf,
And would appreciate any help with the problem I am facing.
Actually I am using a TINY-MCE editor for editing and the text generated by the editor is saved in the
the database at the same time I am generating the pdf using the dompdf plugin.
For certain cases it is generating pdf instantly and in some cases it is generating the below given errors.
Code:
Fatal error: Uncaught exception 'DOMPDF_Internal_Exception' with message 'Frame not found in cellmap' in /home/bobby/public_html/system/plugins/dompdf/include/cellmap.cls.php:262
Stack trace: #0 /home/bobby/public_html/system/plugins/dompdf/include/table_row_group_frame_reflower.cls.php(78):
Cellmap->get_frame_width(Object(Table_Row_Group_Frame_Decorator))
#1 /home/bobby/public_html/system/plugins/dompdf/include/frame_decorator.cls.php(387): Table_Row_Group_Frame_Reflower->reflow()
#2 /home/bobby/public_html/system/plugins/dompdf/include/table_frame_reflower.cls.php(468): Frame_Decorator->reflow()
#3 /home/bobby/public_html/system/plugins/dompdf/include/frame_decorator.cls.php(387): Table_Frame_Reflower->reflow()
#4 /home/bobby/public_html/system/plugins/dompdf/include/block_frame_reflower.cls.php(408): Frame_Decorator->reflow()
#5 /home/bobby/public_html/system/plugins/dompdf/include/frame_decorator.cls.php(387): Block_Frame_Reflower->reflow()
#6 /home/bobby/public_html/system/plugins/dompdf/include/page_frame_reflower.c in /home/bobby/public_html/system/plugins/dompdf/include/cellmap.cls.php on line 262
I tried a lot to debug it but could not resolve it, Even the html is being generated correctly, I don't know where it is going wrong.
The following is the controller code which I am using and below that on is code for the to_pdf_pi file followed by the generated html code which needs to be converted into pdf.
Code:
$this->load->plugin('to_pdf_pi'); //loading the plug-in
$data['id'] = $recordID;
$html = $this->load->view('path/to/thepdfview/ToPdf', $data, true);
//echo $hmtl;die;
$flag = pdf_create($html,$file,FALSE);
var_dump($flag);
Code for the to_pdf_pi.php file
Code:
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
function pdf_create($html, $filename)
{
include_once BASEPATH.'plugins/dompdf/dompdf_config.inc.php';
include_once BASEPATH.'plugins/convertcharset/ConvertCharset.class.php';
$dompdf = new DOMPDF();
$convertcharset = new ConvertCharset();
$html = $convertcharset->Convert($html, 'utf-8', 'iso-8859-1');
$dompdf->load_html($html);
$dompdf->render();
file_put_contents($filename, $dompdf->output());
//$dompdf->stream($filename.".pdf", false); //commented to prevent instant pdf popup and save
//the file on server without downloading it.
}
?>
The generated html code is posted in the next post since, the space is not enough its a long html page.
so please don't mind and help me,
Thanks in Advance.