Forum


Replies: 8   Views: 3530
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 admin  · 11-04-2013 - 12:13

Hello,

I've been checking your DOC after exporting it to DOCX. The problem is that you're merging more than one placeholder and
string in the same cell. As using this method

$docx->addTemplateVariable('P_GName', 'image.png', 'image')

the image is replaced with an altchunk tag, Word is unable to read w:r tags that has an altchunk tag and more content.
So the solution it's to set a cell for each placeholder or use replaceTemplateVariableByHTML method that don't use altchunk but other WordML tags.

Regards.