Forum


Replies: 8   Views: 3383
Template crashed when replace templatevariable with image
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 medscope  · 11-04-2013 - 12:13

Hi,

I have tried merge image using,

$Logo="./UserLogos/MRM Banner-crop.gif";
$logo_HTML="<img src='".$Logo."'>";
$docx->replaceTemplateVariableByHTML('logo','inline',$logo_HTML);
and
$docx->replaceTemplateVariableByHTML('logo','block',$logo_HTML);

But the template variable is replace by nothing.

I'm sure the HTML is correct, because When I put a die($logo_HTML); I can see that image in the browser.
But in the resulting document, the template variable is replaced with blank.

Another thing is that, when we put everything in a blank new document save it as .docx. The image works fine.
No idea what's going on.