views:

44

answers:

2

I am trying to show custom text on the image using dompdf

<div class="image" style="font-size:25px">
  <img alt="" src="image-url.jpg" />
  <div class="name" style="margin-top: -575px; margin-right: 0; margin-bottom: 0; margin-left: 235px; position: absolute;">
    <font face="High Tower Text"><em><?php print $some-value; ?></em></font>
 </div>
 <div class="current-date" style="margin-top :-510px; margin-right: 0; margin-bottom: 0; margin-left: 235px; position: absolute;">
    <font face="High Tower Text"><em><?php print $some-value; ?></em></font>
  </div>
</div>

but when i try to open it in pdf, first it print image and after that it print the dynamic text, which i am providing.

+1  A: 

DOMPDF does not support position: absolute.

There was an issue posted, but looks like it hasn't been added yet.

A workaround might be to render the image with your text in GD .

alex
Thanks alex for your quick response.
Yogesh
+1  A: 

The upcoming release (0.6.0) will have absolute and fixed positioning support. You can try out the updates in the 0.6.0 beta release which includes this functionality. I created a sample document using your HTML so you can see the new functionality in action.

BrianS