Forum


Replies: 1   Views: 3033
Issue between word and 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 admin  · 08-11-2017 - 15:14

Hello,

addExternalFile and replaceVariable methods use altChunk tags that are only supported by MS Word on Windows. You can read about this on the API method and the common problems of the conversion plugin. LibreOffice, macOS, Google Docs and many other DOCX readers don't support this tag.

There're three document formats to be inserted:

  • Replace placeholders by HTML. The best solution is using the replaceVariableByHTML method; this method generates OOXML (MS Word) tags.
  • Replace placeholders by DOCX. You can merge the DOCX using mergeDocx and then move the content after the placeholder using DOCXPath. There's a receipt about this on: Merge anywhere on the document.
  • Replace placeholders by other document formats (DOC, ODT, MHT, RTF...). Using the conversion plugin you can transform any of the supported formats to DOCX, and then use the previous approach to add and move the content.

All these approaches are compatible with all DOCX readers, so the conversion plugin based on LibreOffice will generate the PDF correctly.

Regards.