Welcome Guest, Not a member yet? Register   Sign In
dompdf problem
#1

[eluser]nandish[/eluser]
Hi guys.
while generating pdf document using dompdf library i had got below error message.


Call to a member function get_id() on a non-object in /webroot/se/htdocs/system/plugins/dompdf/include/cellmap.cls.php on line 560


Thanks
#2

[eluser]hlz[/eluser]
Your source html for the pdf is probably not correct. Could you post that?
#3

[eluser]nandish[/eluser]
This is the view page

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&lt;HTML&gt;
&lt;HEAD&gt;
&lt;!--Created By Nandish @Unosoft Technologies--&gt;
&lt;TITLE&gt;PDFDOCUMENT&lt;/TITLE&gt;
&lt;META NAME="Generator" CONTENT="EditPlus"&gt;
&lt;META NAME="Author" CONTENT=""&gt;
&lt;META NAME="Keywords" CONTENT=""&gt;
&lt;META NAME="Description" CONTENT=""&gt;
&lt;style type="text/css"&gt;
body {
background-color:white;
font-family:arial;
color:black;
}
td{

padding-left:2px;
padding-right:1px;
}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
<table border='1' cellspacing='0' cellpadding='0' width='100%' align='center'>
<tr><td colspan='8' align='center'><h2>Game Schedule Details</h2></td></tr>
<tr><td colspan='8' align="right">
&lt;!--<font color="black">Year:</font> &lt;?php echo $year;?&gt;&nbsp;&nbsp; <font color="black">School Name:</font> &lt;?php echo $schoolName;?&gt;--&gt;
</td>
</tr>
&lt;?php
if (count($res)>0){
?&gt;
<tr id="heading">
<td align ='center'>Home School Name</td>
<td align = 'center'>Guest School Name </td>
<td align = 'center'>Game Date</td>
<td align = 'center'>Day</td>
<td align = 'center'>Time</td>
</tr>
&lt;?php
foreach ($res as $items){

echo "<tr>";
echo "<td>".$items['s_hs_name']."</td>";
echo "<td>".$items['s_gs_name']."</td>";
$matchdate = $items['dt_match_date'];
$date1 = date('m/d/Y', strtotime($matchdate));
$dateandtime = date('Y-M-d-D H:i', strtotime($matchdate));
$dateortime = split(" ", $dateandtime);
$dateandday = split("-",$dateortime[0]);
echo "<td>".$date1."</td>";
echo "<td>".$dateandday[3]."</td>";
echo "<td>".$dateortime[1]."</td>";
echo "</tr>";}
}
else{
echo "<div align='center'><h2>NO GAMESCHEDULE FOR THIS YEAR</h2></div>";
}
?&gt;
</table>
&lt;/body&gt;
&lt;/html&gt;
#4

[eluser]nandish[/eluser]
This is the view page

<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.0 Transitional//EN">
&lt;HTML&gt;
&lt;HEAD&gt;
&lt;!--Created By Nandish @Unosoft Technologies--&gt;
&lt;TITLE&gt;PDFDOCUMENT&lt;/TITLE&gt;
&lt;META NAME="Generator" CONTENT="EditPlus"&gt;
&lt;META NAME="Author" CONTENT=""&gt;
&lt;META NAME="Keywords" CONTENT=""&gt;
&lt;META NAME="Description" CONTENT=""&gt;
&lt;style type="text/css"&gt;
body {
background-color:white;
font-family:arial;
color:black;
}
td{

padding-left:2px;
padding-right:1px;
}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
<table border=’1’ cellspacing=’0’ cellpadding=’0’ width=’100%’ align=’center’>
<tr><td colspan=’8’ align=’center’><h2>Game Schedule Details</h2></td></tr>
<tr><td colspan=’8’ align="right">
&lt;!--<font color="black">Year:</font> &lt;?php echo $year;?&gt; <font color="black">School Name:</font> &lt;?php echo $schoolName;?&gt;--&gt;
</td>
</tr>
&lt;?php
if (count($res)>0){
?&gt;
<tr id="heading">
<td align =’center’>Home School Name</td>
<td align = ‘center’>Guest School Name </td>
<td align = ‘center’>Game Date</td>
<td align = ‘center’>Day</td>
<td align = ‘center’>Time</td>
</tr>
&lt;?php
foreach ($res as $items){

echo "<tr>";
echo "<td>".$items['s_hs_name']."</td>";
echo "<td>".$items['s_gs_name']."</td>";
$matchdate = $items['dt_match_date'];
$date1 = date('m/d/Y', strtotime($matchdate));
$dateandtime = date('Y-M-d-D H:i', strtotime($matchdate));
$dateortime = split(" ", $dateandtime);
$dateandday = split("-",$dateortime[0]);
echo "<td>".$date1."</td>";
echo "<td>".$dateandday[3]."</td>";
echo "<td>".$dateortime[1]."</td>";
echo "</tr>";}
}
else{
echo "<div align='center'><h2>NO GAMESCHEDULE FOR THIS YEAR</h2></div>";
}
?&gt;
</table>
&lt;/body&gt;
&lt;/html&gt;
#5

[eluser]hlz[/eluser]
As far as i can see your colspan=’8' doesn't match with the number of <td>'s generated in the rows. This could be the problem. Another problem could be that your final html-table spans more than 1 page in your PDF. I've had problems with that in the past.
#6

[eluser]nandish[/eluser]
i changed colspan ='8' to colspan='5' after that i execute the code,now i had got this message

Fatal error: Maximum execution time of 30 seconds exceeded in /webroot/se/htdocs/system/plugins/dompdf/include/text_frame_reflower.cls.php(316) : runtime-created function on line 1
#7

[eluser]hlz[/eluser]
Your server is not able to create your PDF within the default 30 seconds a PHP-script can run. You could try to raise the 30 seconds like so:
Code:
ini_set('max_execution_time', '120');
#8

[eluser]nandish[/eluser]
I used set_time_limit(300);
#9

[eluser]pixelazion[/eluser]
if i'm not mistaken this happens when a single table gets taller than the page.
we have the same problem T_T

Here's what i got every time i have a very tall table:
Fatal error: Uncaught exception 'DOMPDF_Internal_Exception' with message 'Frame not found in cellmap' in /var/www/samplesite/system/plugins/dompdf/include/cellmap.cls.php:237
Stack trace:
/var/www/samplesite/system/plugins/dompdf/include/table_cell_frame_reflower.cls.php(66): Cellmap-&gt;get_frame_position(Object(Table_Cell_Frame_Decorator))
/var/www/samplesite/system/plugins/dompdf/include/frame_decorator.cls.php(387): Table_Cell_Frame_Reflower-&gt;reflow()
/var/www/samplesite/system/plugins/dompdf/include/table_row_frame_reflower.cls.php(70): Frame_Decorator-&gt;reflow()
/var/www/samplesite/system/plugins/dompdf/include/frame_decorator.cls.php(387): Table_Row_Frame_Reflower-&gt;reflow()
/var/www/samplesite/system/plugins/dompdf/include/table_frame_reflower.cls.php(468): Frame_Decorator-&gt;reflow()
/var/www/samplesite/system/plugins/dompdf/include/frame_decorator.cls.php(387): Table_Frame_Reflower-&gt;reflow()
/var/www/samplesite/system/plugins/dompdf/include/block_frame_reflower.cls.php(408): Frame_Decorator-&gt;reflow in /var/www/samplesite/system/plugins/dompdf/include/cellmap.cls.php on line 237

Help anyone T_T
#10

[eluser]Derek Allard[/eluser]
I found and fixed that error (the tall table one) in Bamboo... but honestly, it was so long ago that I don't remember how. You may want to download it and compare the DOMPDF versions. Also, DOMPDF has a critical security vulnerability in it that (to my knowledge) is as yet unpatched. Be sure you follow their instructions for working around it.




Theme © iAndrew 2016 - Forum software by © MyBB