I'm using the trial version of phpdocx and it goes like this :
...
$docx->replaceVariableByText($variables);
$docx->replaceVariableByText($variables_header, ['target' => "header"]);
...
$docx->embedHTML($html);
$docx->createDocxAndDownload('temp/Business Plan');
All is fine. When I open it in Libre Office, it shows up fine.
But when I open it in Microsoft Word, I get this error : http://i.imgur.com/e70KZFc.jpg
"We're sorry. We can't open [document name] because we found a problem with its contents." and "Word found unreadable content in [document name]. Do you want to recover the contents of this document? If you trust the source of this document, click Yes."
Is there any way to resolve this ? Everything is fine in the docx when I click on OK. But I need to get rid off this error.