PDF generation
Posted: Mon Feb 04, 2008 4:52 am
Anybody using DOMPDF? I have used it for quite a while and it worked pretty well until I need to add dynamic images and content. I noticed that the image alignment does not work e.g.
The HTML template itself is XHTML validated, and the page works fine in browser but when converted to PDF, the text is not wrapped around the image. Instead the image is moved down to new paragraph. 
I think I nailed the issue down to "attribute_translator.cls.php" file
I don't know what the author meant by "img tags actually end up wrapping img_inner elements". Documentation is a bit bare and no responses at SourceForge forum.
Code: Select all
<img src="someimage.jpg" height="200" width="400" align="right" />I think I nailed the issue down to "attribute_translator.cls.php" file
Code: Select all
'img_inner' => // img tags actually end up wrapping img_inner elements
array ('align' => array('bottom' => 'vertical-align: baseline;',
'middle' => 'vertical-align: middle;',
'top' => 'vertical-align: top;',
'left' => 'float: left;',
'right' => 'float: right;'),
'border' => 'border-width: %0.2f px;',
'height' => 'height: %s;',
'hspace' => 'padding-left: %1$0.2f px; padding-right: %1$0.2f px;',
'vspace' => 'padding-top: %1$0.2f px; padding-top: %1$0.2f px',
'width' => 'width: %s;',
),