From 3ea8d571e7e6ff96a3e025b713e11d55688c8439 Mon Sep 17 00:00:00 2001 From: b_b Date: Fri, 10 Jul 2020 00:50:45 +0200 Subject: [PATCH] Fix PDF import with libreoffice (#4156) Fix #4151 --- src/node/utils/LibreOffice.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/node/utils/LibreOffice.js b/src/node/utils/LibreOffice.js index 267f7a0cd..12a98fa48 100644 --- a/src/node/utils/LibreOffice.js +++ b/src/node/utils/LibreOffice.js @@ -44,6 +44,10 @@ exports.convertFile = function(srcFile, destFile, type, callback) { if (type === "html") { // "html:XHTML Writer File:UTF8" does a better job than normal html exports type = "html:XHTML Writer File:UTF8"; + // PDF files need to be converted with LO Draw ref https://github.com/ether/etherpad-lite/issues/4151 + if (path.extname(srcFile).toLowerCase() === ".pdf") { + type = "html:XHTML Draw File" + } } // soffice can't convert from html to doc directly (verified with LO 5 and 6)