From edb1c87a4e4cbac36483d434c1e1cfa5d25c771e Mon Sep 17 00:00:00 2001 From: zhijie <1003392067@qq.com> Date: 星期四, 19 十月 2023 23:19:42 +0800 Subject: [PATCH] bugfix --- src/main/java/com/ots/common/utils/poi/WordUtil.java | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/ots/common/utils/poi/WordUtil.java b/src/main/java/com/ots/common/utils/poi/WordUtil.java index 4d7ec5d..dea980f 100644 --- a/src/main/java/com/ots/common/utils/poi/WordUtil.java +++ b/src/main/java/com/ots/common/utils/poi/WordUtil.java @@ -24,6 +24,7 @@ import org.apache.commons.collections.map.HashedMap; import org.apache.poi.ooxml.POIXMLDocument; import org.apache.poi.openxml4j.exceptions.InvalidFormatException; +import org.apache.poi.openxml4j.util.ZipSecureFile; import org.apache.poi.util.Units; import org.apache.poi.xwpf.usermodel.*; import org.apache.xmlbeans.XmlCursor; @@ -1183,6 +1184,8 @@ if(ReportTypeEnum.PAQ.getCode().equals(reportType) || ReportTypeEnum.MAQTR.getCode().equals(reportType) || ReportTypeEnum.CIAQ.getCode().equals(reportType)){ PdfUtil.convertPDF(EssConfig.getProfile() + "/" + reportName); + }else if(ReportTypeEnum.LAQ.getCode().equals(reportType)){ + PdfUtil.convertPythonPDF(EssConfig.getDocx2pdfPath(),EssConfig.getProfile() + "/" + reportName); }else{ ShellTool.execLibreofficeCommand("pdf", EssConfig.getProfile() + "/" + reportName, EssConfig.getProfile() + "/"); // ShellTool shellTool = ShellTool.builder(); @@ -1282,6 +1285,7 @@ */ private static void setChageWord(String fileName, OutputStream out, Map<String, Object> textMap, String reportType,String dataPath, Map<Integer, Map<Integer, List<String[]>>> autoTableMap) throws IOException, InvalidFormatException, DocumentException { //String filePath = getTemplateDownLoadPathByUpLoad(fileName); + ZipSecureFile.setMinInflateRatio(0.001); XWPFDocument document = new XWPFDocument(POIXMLDocument.openPackage(getTemplateDownLoadPathByUpLoad(fileName))); -- Gitblit v1.9.1