vikrambalye / dompdf

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

Height alignment from non conversion of px->pt #322

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.  Centering an image inside a div, the div with px absolute w/h the image 
with variable height.
2.  Generate PDF with this code.

style
  .logo_div { position: absolute; top: 1in; left: 2in; text-align: center; height: 100px; width: 444px; border: 1px solid black; }
  .logo     { height: 50%; border: 2px solid gray; }
/style
body
div class="logo_div"
img class="logo" src="http:\\anyimage" /
/div
/body

What is the expected output? What do you see instead?
Image will not align properly in containing div.

What version of the product are you using? On what operating system?
Newest from trunk as of Friday 7/1. Win 7 

Please provide any additional information below.

Couple of places in the code I was able to test this.  
image_frame_reflower.cls.php
 -> get_min_max_width() line 122 $f->get_style()->height is returning px instead of pt.  Can see this with DEBUGPNG at the top of this function, for this code I get:
get_min_max_width() w=auto h= 50%; w= 333pt h= 100px; w=543.96850393701pt h= 
auto;64 64

block_frame_reflower.cls.php
 -> reflow() lines 721-727 are not appending 'pt' like the width counter part above (this could be by design?).  This fixes the $style->height and properly sets 75pt for this sample, but somewhere outside of the reflow function the style is being reset to 100px.

I found calling $style->length_in_pt() from the get_min_max_width() function 
will correct but width is properly being converted, trying to be productive and 
track it down.

Original issue reported on code.google.com by mechjag...@gmail.com on 7 Jul 2011 at 8:14

GoogleCodeExporter commented 9 years ago
I need to clarify this, it isn't the alignment but sizing when using a height 
percentage.

Original comment by mechjag...@gmail.com on 7 Jul 2011 at 8:17

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r412.

Original comment by fabien.menager on 12 Jul 2011 at 9:24

GoogleCodeExporter commented 9 years ago

Original comment by eclecticgeek on 30 May 2013 at 5:16