Forum


Replies: 3   Views: 3537
Replacevariablebyexternalfile not working in trial version.
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 pbg@pbgpersonnel.ru  · 14-04-2015 - 13:54

require_once('../../../tools/4.6/lib/log4php/Logger.php'); require_once('../../../tools/4.6/classes/CreateDocx.inc'); $docx = new CreateDocxFromTemplate('TemplateExternalFile.docx'); $docx->replaceVariableByExternalFile(array('EXTERNAL' => 'External.docx'), array('matchSource' => true)); $docx->createDocx('example_replaceVariableByExternalFile_1'); // In output file variable EXTERNAL is empty. //Executed in CLI with php version 5.3.18 and 5.5.9. There are no errors. In browser not working too.

Posted by admin  · 14-04-2015 - 14:13

Hello, The method works perfectly, but be aware that this method uses the altchunk. As explained in the documentation this tag is supported only by MS Word 2007 and newer, and only with Windows. Regards.

Posted by pbg@pbgpersonnel.ru  · 14-04-2015 - 14:45

I'm working on linux and use libre office, my customer using iOS :) I need to replace a variable in the template table as advise to do it? Table is created using addTable.

Posted by admin  · 15-04-2015 - 08:59

Hello, You can use one of these methods: replaceListVariable, replaceTableVariable, replaceVariableByHtml, replaceVariableByText or replaceVariableByWordFragment. If you need to merge the DOCX you can use the MultiMerge but it's only available for the Corporate and Enterprise licenses. Regards.