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.