From bad2cbc494771ccd05fa951e5e6eecf8238c0642 Mon Sep 17 00:00:00 2001 From: chenxudong Date: Wed, 13 Aug 2025 09:36:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=81=A2=E5=A4=8D=E5=88=B0=E4=BB=A5=E5=89=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- electromagnetic-common/pom.xml | 4 ++-- .../industry/software/common/util/OfficeFileUtil.java | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/electromagnetic-common/pom.xml b/electromagnetic-common/pom.xml index d6d79ca..39d1e96 100644 --- a/electromagnetic-common/pom.xml +++ b/electromagnetic-common/pom.xml @@ -58,12 +58,12 @@ com.documents4j documents4j-local - 1.1.3 + 1.0.3 com.documents4j documents4j-transformer-msoffice-word - 1.1.3 + 1.0.3 diff --git a/electromagnetic-common/src/main/java/com/electromagnetic/industry/software/common/util/OfficeFileUtil.java b/electromagnetic-common/src/main/java/com/electromagnetic/industry/software/common/util/OfficeFileUtil.java index 74fce03..0cb766a 100644 --- a/electromagnetic-common/src/main/java/com/electromagnetic/industry/software/common/util/OfficeFileUtil.java +++ b/electromagnetic-common/src/main/java/com/electromagnetic/industry/software/common/util/OfficeFileUtil.java @@ -51,13 +51,11 @@ public class OfficeFileUtil { } log.info("Start convert word file to pdf, word path: {}, pdf path: {}", wordPath, pdfPath); if (EleCommonUtil.isWinOs()) { - String tmpPath = FileUtil.getParent(pdfPath, 1); - File workDir = new File(tmpPath); File inputWord = new File(wordPath); File outputFile = new File(pdfPath); try (InputStream docxInputStream = Files.newInputStream(inputWord.toPath()); OutputStream outputStream = Files.newOutputStream(outputFile.toPath())) { - IConverter build = LocalConverter.builder().baseFolder(workDir).build(); + IConverter build = LocalConverter.builder().build(); boolean execute; if (wordPath.endsWith(".docx")) { execute = build.convert(docxInputStream)