Forum


Replies: 4   Views: 4299
Lib crashes when i try to replace several image placeholder in header
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 jdespatis  · 15-07-2014 - 10:10

I have a template with 2 placeholders in the header ($HEADERIMG$ and $LOGO$) and I use the following test code: $docx = new \CreateDocxFromTemplate("replacePlaceholderImages.docx"); $docx->replacePlaceholderImage('HEADERIMG', 'images/user.png', array("target" => "header")); $docx->replacePlaceholderImage('LOGO', 'images/qrcode.png', array("target" => "header")); $docx->createDocx('/tmp/example_replacePlaceholderImages_1'); And i get the PHP error: ContextErrorException: Warning: DOMDocument::loadXML(): Empty string supplied as input in [...]/phpdocx/classes/CreateDocxFromTemplate.inc line 1096 (indeed, after first replacing HEADERIMG placeholder, the lib seems to clean the LOGO placeholder in the same time, from pov) => bug in library or I'm badly using the lib ? Thanks for your feedback