Forum


Replies: 5   Views: 3673
Using replacevariablebyhtml to generate a document with a centered image does not seem to work.
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 nicks  · 01-11-2015 - 17:05

I'm using ckeditor to allow my users to create content, including pictures that can be justified center. An example of the HTML generates is below:

<p style="text-align:center"><img alt="" height="500" src="ckeditor/plugins/imageuploader/../../../ckeditor/plugins/imageuploader/uploads/113995b1.png" width="900" /></p>

While it includes the image fine, it is always left justified. No filtering is in place that I know of, and just to prove a point, I created a one off test page:

<?php
require_once '../phpdocx_corporate-new/classes/CreateDocx.inc';
$docx = new CreateDocxFromTemplate('Report_Empty1.docx');
$docx->replaceVariableByHTML('PIC', 'inline', '<center><img alt="" height="500" src="ckeditor/plugins/imageuploader/../../../ckeditor/plugins/imageuploader/uploads/113995b1.png" width="900" /></center>
', array('isFile' => false, 'parseDivsAsPs' => true, 'downloadImages' => true));
$docx->createDocx('Output3');
?>

Am I missing something, or is a bug?