Forum


Replies: 4   Views: 4270
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 - 15:52

Ok, so I've done a new try: I've created a new template from scratch, with 2 different images as placeholders ($logo$ and $qrcode$) in the header (here is my template rendered: http://screencast.com/t/gyZgkIEHY2y, I can send it to you, no problem) And then I replace those 2 placeholders with 2 different images (indeed, all those 4 images are all different), thanks to the code: $docx = new \CreateDocxFromTemplate("TestTemplate2.docx"); $docx->replacePlaceholderImage('logo', 'images/user.png', array("target" => "header")); $docx->replacePlaceholderImage('qrcode', 'images/event.jpg', array("target" => "header")); $docx->createDocx('/tmp/example_replacePlaceholderImages_1'); But I get the same exception (and the resulting docx is not generated): ContextErrorException: Warning: DOMDocument::loadXML(): Empty string supplied as input in [...]/phpdocx/classes/CreateDocxFromTemplate.inc line 1096 Any idea ?