Commit ae32497e authored by 赵啸非's avatar 赵啸非

修改同步业务逻辑

parent 7be20221
Pipeline #2873 canceled with stages
...@@ -162,6 +162,13 @@ ...@@ -162,6 +162,13 @@
<!-- <classifier>jdk17</classifier>--> <!-- <classifier>jdk17</classifier>-->
<!-- </dependency>--> <!-- </dependency>-->
<dependency>
<groupId>net.coobird</groupId>
<artifactId>thumbnailator</artifactId>
<version>0.4.20</version>
</dependency>
<dependency> <dependency>
<groupId>com.aspose.words</groupId> <groupId>com.aspose.words</groupId>
<artifactId>aspose-words</artifactId> <artifactId>aspose-words</artifactId>
......
...@@ -15,6 +15,7 @@ import freemarker.template.Configuration; ...@@ -15,6 +15,7 @@ import freemarker.template.Configuration;
import freemarker.template.Template; import freemarker.template.Template;
import lombok.extern.apachecommons.CommonsLog; import lombok.extern.apachecommons.CommonsLog;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import net.coobird.thumbnailator.Thumbnails;
import org.apache.pdfbox.pdmodel.PDDocument; import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.rendering.PDFRenderer; import org.apache.pdfbox.rendering.PDFRenderer;
...@@ -27,6 +28,7 @@ import java.util.ArrayList; ...@@ -27,6 +28,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@Slf4j @Slf4j
public class WordUtil { public class WordUtil {
...@@ -107,7 +109,11 @@ public class WordUtil { ...@@ -107,7 +109,11 @@ public class WordUtil {
log.info("转换结束,开始拼接图片:{}",pageCount); log.info("转换结束,开始拼接图片:{}",pageCount);
BufferedImage mergeImage = mergeImage(false, imageList); BufferedImage mergeImage = mergeImage(false, imageList);
ImageIO.write(mergeImage, "png", file); Thumbnails.of(mergeImage)
.scale(1f)
.outputQuality(0.5f).toFile(file);
// ImageIO.write(mergeImage, "jepg", file);
// 转换结束后时间 // 转换结束后时间
/* doc.save(jpegPath);*/ /* doc.save(jpegPath);*/
doc.cleanup(); doc.cleanup();
...@@ -133,6 +139,9 @@ public class WordUtil { ...@@ -133,6 +139,9 @@ public class WordUtil {
} }
public static void pdfToImages(String filePath, String jpegPath) { public static void pdfToImages(String filePath, String jpegPath) {
log.info(String.format("pdf to images文件转换开始:%s", DateUtils.getCurrStrDateTime())); log.info(String.format("pdf to images文件转换开始:%s", DateUtils.getCurrStrDateTime()));
// 转换开始前时间 // 转换开始前时间
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment