Forum


Replies: 4   Views: 2425
Replacevariablebywordfragment and mergedocx errors
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 jim.alexander@fundingbenchmarks.org  · 01-12-2017 - 13:40

Hi,

I have a two .docx files that I want to merge. One file is simple docx, and one file has been previously created from a template and contains only a single barchart.

Both .docx files are readable and the bar chart appears as expected in the .docx.

I use this to insert the barchart into the file.

    $chart = new WordFragment($docx, 'document');
    $chart->addChart($paramsChart);
    $docx->replaceVariableByWordFragment(array('Ranking_1' => $chart), array('type' => 'inline'));
$docx->createDocx($OutputFile_1);

when I try to merge this file ( $merge = new MultiMerge();) I always get the error:

"Fatal error: Call to a member function setAttribute() on a non-object in C:\wamp\www\fb\public_html\phpdocx\classes\MultiMerge.inc on line 1713"

Help?

Thanks.

Jim.