From 08b83ae35841a45f3fe51ffe2d00499656e8da6c Mon Sep 17 00:00:00 2001 From: John McLear Date: Sun, 29 Mar 2020 12:09:08 +0000 Subject: [PATCH] LibreOffice: use "html:XHTML Writer File:UTF8" export method This yields better conversion results, but requires the previous change, otherwise there would have been difficulties in locating the temporary file name. --- src/node/utils/LibreOffice.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/node/utils/LibreOffice.js b/src/node/utils/LibreOffice.js index e2c6430b..267f7a0c 100644 --- a/src/node/utils/LibreOffice.js +++ b/src/node/utils/LibreOffice.js @@ -41,6 +41,11 @@ exports.convertFile = function(srcFile, destFile, type, callback) { // Used for the moving of the file, not the conversion var fileExtension = type; + if (type === "html") { + // "html:XHTML Writer File:UTF8" does a better job than normal html exports + type = "html:XHTML Writer File:UTF8"; + } + // soffice can't convert from html to doc directly (verified with LO 5 and 6) // we need to convert to odt first, then to doc // to avoid `Error: no export filter for /tmp/xxxx.doc` error