Forum


Replies: 1   Views: 2426
Content added by replacevariablebyexternalfile doesn't show on libreoffice
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 francesco.consiglio  · 02-05-2018 - 13:20

Hello,

in my script whenever I add content to my main template using replaceVariableByExternalFile(), when I open the document with Microsoft Word the parts added by the external fine show up just fine, but when opening the document with LibreOffice they do not. 

This is also reflected in the PDF conversion.

Using the latest version of phpdocx 8.0 Advanced (just purchased).

Thanks in advance!

Posted by admin  · 02-05-2018 - 14:16

Hello,

replaceVariableByExternalFile and addExternalFile methods use altChunk tags that are only compatible with MS Word 2007 or newer.; LibreOffice (and also the conversion plugin) doesn't support this tag. This is explained on the API pages of these methods:

This method is not compatible with thephpdocx PDF conversion plugin.

And the conversion plugin information page (https://www.phpdocx.com/documentation/conversion-plugin/common-problems-and-possible-errors):

  • altChunk tag: The addExternalFile and replaceVariableByExternalFile methods use the Word altChunk internal tag. This allows to insert external files in a Word document. This tag is MS Word supported only, so it's not compatible with the conversion plugin.

Instead of using altChunk tags, if you need to embed HTML please use embedHTML or replaceVariableByHTML methods. If you need to merge DOCX, please use mergeDocx. These methods are compatible with any DOCX reader.

Regards.