vikrambalye / dompdf

Automatically exported from code.google.com/p/dompdf
0 stars 0 forks source link

HTML table with DIVs ended up in error #337

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.In the DEMO section i pasted the following code.
<html>
<head>
<style>

/* Type some style rules here */

</style>
</head>

<body>

<table id='roomContainer' cellpadding='0' cellspacing='0' border='0' 
bgcolor='#CCCCCC' align='center'>
                    <tbody>
                        <tr>
                            <td></td>
                            <td class='sliderHor'><div id='sliderA' style='display:none; '></div></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td class='sliderVer'><div id='sliderD' style='display:none; '></div></td>
                            <td>
                                <table id='room' cellpadding='0' cellspacing='0' border='0'>
                                    <tbody>
                                        <tr bgcolor='#919596'>
                                            <td width='40px' height='40px' background='images/bg_l_t.png'><img src='images/spacer.gif' width='40px' height='40px' /></td>
                                            <td height='40px' style='vertical-align:bottom; '><div id='tWallTop' style='position:relative; height:100%; width:100%; '></div></td>
                                            <td width='40px' height='40px' background='images/bg_r_t.png'><img src='images/spacer.gif' width='40px' height='40px' /></td>
                                        </tr>
                                        <tr>
                                            <td bgcolor='#919596' width='40px' align='right' style='vertical-align:top; '><div id='tWallLeft' style='position:relative; height:100%; '></div></td>
                                            <td id='tblRoom' background='images/bg.bmp'></td>
                                            <td bgcolor='#919596' width='40px' align='left' style='vertical-align:top; '><div id='tWallRight' style='position:relative; height:100%; '></div></td>
                                        </tr>
                                        <tr bgcolor='#919596'>
                                            <td width='40px' height='40px' background='images/bg_r_t.png'><img src='images/spacer.gif' width='40px' height='40px' /></td>
                                            <td height='40px' style='vertical-align:top; '><div id='tWallBot' style='position:relative; height:100%; width:100%; '></div></td>
                                            <td width='40px' height='40px' background='images/bg_l_t.png'><img src='images/spacer.gif' width='40px' height='40px' /></td>
                                        </tr>
                                    </tbody>
                                </table>
                            </td>
                            <td class='sliderVer'><div id='sliderB' style='display:none; '></div></td>
                        </tr>
                        <tr>
                            <td></td>
                            <td class='sliderHor'><div id='sliderC' style='display:none; '></div></td>
                            <td></td>
                        </tr>
                    </tbody>
                </table>

</body>
</html>

What is the expected output? What do you see instead?
A Room like table was expected output. but showd the error appended below.

What version of the product are you using? On what operating system?

Please provide any additional information below.

Deprecated: Function set_magic_quotes_runtime() is deprecated in 
C:\wamp\www\kuchenworld.co.uk\dompdf\lib\class.pdf.php on line 4332

Deprecated: Function set_magic_quotes_runtime() is deprecated in 
C:\wamp\www\kuchenworld.co.uk\dompdf\lib\class.pdf.php on line 4348

Deprecated: Function set_magic_quotes_runtime() is deprecated in 
C:\wamp\www\kuchenworld.co.uk\dompdf\lib\class.pdf.php on line 4332

Deprecated: Function set_magic_quotes_runtime() is deprecated in 
C:\wamp\www\kuchenworld.co.uk\dompdf\lib\class.pdf.php on line 4348

Fatal error: Uncaught exception 'DOMPDF_Internal_Exception' with message 'Frame 
not found in cellmap' in 
C:\wamp\www\kuchenworld.co.uk\dompdf\include\cellmap.cls.php:262 Stack trace: 
#0 
C:\wamp\www\kuchenworld.co.uk\dompdf\include\table_row_group_frame_reflower.cls.
php(78): Cellmap->get_frame_width(Object(Table_Row_Group_Frame_Decorator)) #1 
C:\wamp\www\kuchenworld.co.uk\dompdf\include\frame_decorator.cls.php(387): 
Table_Row_Group_Frame_Reflower->reflow() #2 
C:\wamp\www\kuchenworld.co.uk\dompdf\include\table_frame_reflower.cls.php(468): 
Frame_Decorator->reflow() #3 
C:\wamp\www\kuchenworld.co.uk\dompdf\include\frame_decorator.cls.php(387): 
Table_Frame_Reflower->reflow() #4 
C:\wamp\www\kuchenworld.co.uk\dompdf\include\table_cell_frame_reflower.cls.php(1
15): Frame_Decorator->reflow() #5 
C:\wamp\www\kuchenworld.co.uk\dompdf\include\frame_decorator.cls.php(387): 
Table_Cell_Frame_Reflower->reflow() #6 
C:\wamp\www\kuchenworld.co.uk\dompdf\include\table_row_frame_reflower.cls.php(70
): Frame_Decorator->reflow() #7 C:\wamp\www\kuch in 
C:\wamp\www\kuchenworld.co.uk\dompdf\include\cellmap.cls.php on line 262

Original issue reported on code.google.com by khaled.j...@gmail.com on 16 Aug 2011 at 11:19

GoogleCodeExporter commented 9 years ago
DOMPDF does appear to have issues rendering this, but we'll have to look at 
exactly what's going on.

In the meantime, the DIV element styled with a height of 100% is breaking 
things. Recommend you modify the styling there if you can.

Two notes regarding posting bugs: It's hard to debug against the 
desired/correct output if you don't also include the images/styles. Also, it's 
easier on us if you attach the code rather than paste it inline.

Original comment by eclecticgeek on 16 Aug 2011 at 6:10

GoogleCodeExporter commented 9 years ago
I have a similar issue.  If you try to render the output of this page [ 
http://www.omiss.net/Facelift/MemberReport.php?OMNum=6066&prt=N ]  with dompdf 
you get the same deprecation errors. I do not have DIV elements with a height 
of 100% but I do have DIV elements.   NOTE: This page has been validated by the 
W3C validation service. 

Original comment by k0...@comcast.net on 19 Oct 2011 at 1:25

GoogleCodeExporter commented 9 years ago
So Sorry - incorrect url in the last comment.

[ http://www.omiss.net/Facelift/GenMemberReport.php?OMNum=6066&prt=N ]

Original comment by k0...@comcast.net on 19 Oct 2011 at 1:27

GoogleCodeExporter commented 9 years ago
@k0jdd what version of dompdf are you using? The "deprecated" errors are 
unrelated to the div issue. dompdf 0.5.1 had called the 
set_magic_quotes_runtime() function, but it has been removed from the 0.6.0 
beta. We recommend you upgrade if possible. Otherwise you can comment the line 
where that function appears (as specified in the error message). It shouldn't 
affect the functionality of dompdf.

Also, you may want to disable the display of error messages from PHP. These 
errors did not prevent dompdf from rendering the document, but it was unable to 
send the document to the browser because other content had already been sent.

Original comment by eclecticgeek on 19 Oct 2011 at 1:47

GoogleCodeExporter commented 9 years ago
I commented out the function calls as I do not have time to trythe  0.6.0 beta 
right now.

BTW - I was unable to disable PHP errors with php_error(0).  That might be a 
hosting thing.  o.O 

OTOH - How will I know if it breaks again, if there are no errors displayed ;-)

Thanks, and thanks to all for a great PHP Class.

Original comment by k0...@comcast.net on 19 Oct 2011 at 2:00

GoogleCodeExporter commented 9 years ago
It seems, like adding two lines to block_frame_reflower.cls.php fixes this 
issue.

Just add:
  $style->top = $orig_style->top;
  $style->bottom = $orig_style->bottom;

after:
      $style->left = $orig_style->left;
      $style->right = $orig_style->right;
in // Absolute positioning measurement line: 782

and DIVs are positioned correctly.

Original comment by grzegorz...@gmail.com on 5 Mar 2013 at 8:24

GoogleCodeExporter commented 9 years ago

Original comment by eclecticgeek on 24 May 2013 at 3:00