Forum


Replies: 5   Views: 4668
Replacevariablebyhtml image width percent not applying
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by pderep  · 10-06-2016 - 12:47

Hello,

Thanks for your answer.

My goal is to scale the image relative to the width of the column; problem is, using CSS doesn't work either:

     $docx = new CreateDocxFromTemplate('htmltest.docx');
        $pdm = <<<EOT
<table width="100%">
        <tr>
                <td width="33%" ><img style="width:75%" src="image1.jpg"></td>
                <td width="33%" ><img style="width:75%" src="image2.jpg"></td>
                <td width="33%" ><img style="width:75%" src="image3.png"></td>
        </tr>
</table>
EOT;

        $docx->replaceVariableByHTML('PDM', 'block', $pdm, array('isFile' => false, 'parseFloats' => true, 'parseDivsAsPs' => true, 'downloadImages' => true));
        $docx->createDocx('htmltest_out');         

Regards,

PdR