From 3ff670cd5141de642d9e7e8206beb0da89aa6e5e Mon Sep 17 00:00:00 2001 From: Jarrett <291979254@qq.com> Date: Sun, 17 Nov 2024 11:47:21 +0800 Subject: [PATCH] fix: fix ppt converter error --- .../java/com/jiaruiblog/task/executor/slider/PptExecutor.java | 4 ++-- src/main/java/com/jiaruiblog/util/poi/PptToPDFConverter.java | 3 +-- .../com/jiaruiblog/controller/DocReviewControllerTest.java | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/jiaruiblog/task/executor/slider/PptExecutor.java b/src/main/java/com/jiaruiblog/task/executor/slider/PptExecutor.java index 5921e2c..da1ff57 100644 --- a/src/main/java/com/jiaruiblog/task/executor/slider/PptExecutor.java +++ b/src/main/java/com/jiaruiblog/task/executor/slider/PptExecutor.java @@ -8,7 +8,7 @@ import com.jiaruiblog.task.executor.TaskExecutor; import com.jiaruiblog.util.poi.Converter; import com.jiaruiblog.util.poi.PPTUtil; -import com.jiaruiblog.util.poi.PptxToPDFConverter; +import com.jiaruiblog.util.poi.PptToPDFConverter; import java.io.IOException; import java.io.InputStream; @@ -41,7 +41,7 @@ protected void makePreviewFile(InputStream inStream, TaskData taskData) { taskData.setPreviewFilePath(UUID.randomUUID() + ".pdf"); try { OutputStream outStream = getOutFileStream(taskData.getPreviewFilePath()); - Converter converter = new PptxToPDFConverter(inStream, outStream, true, + Converter converter = new PptToPDFConverter(inStream, outStream, true, true); converter.convert(); } catch (Exception e) { diff --git a/src/main/java/com/jiaruiblog/util/poi/PptToPDFConverter.java b/src/main/java/com/jiaruiblog/util/poi/PptToPDFConverter.java index 68aa2a9..009ea86 100644 --- a/src/main/java/com/jiaruiblog/util/poi/PptToPDFConverter.java +++ b/src/main/java/com/jiaruiblog/util/poi/PptToPDFConverter.java @@ -13,7 +13,6 @@ import java.io.InputStream; import java.io.OutputStream; import java.util.ArrayList; -import java.util.List; /** *
@@ -24,7 +23,7 @@ */ public class PptToPDFConverter extends Converter { - protected PptToPDFConverter(InputStream inStream, OutputStream outStream, boolean showMessages, boolean closeStreamsWhenComplete) { + public PptToPDFConverter(InputStream inStream, OutputStream outStream, boolean showMessages, boolean closeStreamsWhenComplete) { super(inStream, outStream, showMessages, closeStreamsWhenComplete); } diff --git a/src/test/java/com/jiaruiblog/controller/DocReviewControllerTest.java b/src/test/java/com/jiaruiblog/controller/DocReviewControllerTest.java index 311d228..be3dd0c 100644 --- a/src/test/java/com/jiaruiblog/controller/DocReviewControllerTest.java +++ b/src/test/java/com/jiaruiblog/controller/DocReviewControllerTest.java @@ -652,7 +652,7 @@ public void removeLogTest1() throws Exception { .contentType(MediaType.APPLICATION_JSON) // 设置返回值类型为utf-8,否则默认为ISO-8859-1 .accept(MediaType.APPLICATION_JSON) - .content(json.toJSONString())) + .content(json.toString())) .andExpect(MockMvcResultMatchers.status().isOk()) .andReturn();