diff --git a/emis-biz-web/emis-biz-web.iml b/emis-biz-web/emis-biz-web.iml index 5629c9673..b1cd21295 100644 --- a/emis-biz-web/emis-biz-web.iml +++ b/emis-biz-web/emis-biz-web.iml @@ -271,9 +271,9 @@ - + - + diff --git a/emis-biz/emis-biz.iml b/emis-biz/emis-biz.iml index 781b7da7a..2a9ef1033 100644 --- a/emis-biz/emis-biz.iml +++ b/emis-biz/emis-biz.iml @@ -230,9 +230,9 @@ - + - + diff --git a/emis-biz/lib/aspose-words-19.1-jdk16.jar b/emis-biz/lib/aspose-words-19.1-jdk16.jar new file mode 100644 index 000000000..d78e0fb31 Binary files /dev/null and b/emis-biz/lib/aspose-words-19.1-jdk16.jar differ diff --git a/emis-biz/pom.xml b/emis-biz/pom.xml index 472ca1905..dce189746 100644 --- a/emis-biz/pom.xml +++ b/emis-biz/pom.xml @@ -151,15 +151,26 @@ 1.10.6 + + + + + + + + com.aspose aspose-words - 15.8.0 + 19.1.0 system - ${project.basedir}/lib/aspose-words-15.8.0-jdk16.jar + ${project.basedir}/lib/aspose-words-19.1-jdk16.jar + + + diff --git a/emis-biz/src/main/java/com/xdadan/erp/emis/service/warehouse/DocUtils.java b/emis-biz/src/main/java/com/xdadan/erp/emis/service/warehouse/DocUtils.java index 55f94c41f..9d9fe5df6 100644 --- a/emis-biz/src/main/java/com/xdadan/erp/emis/service/warehouse/DocUtils.java +++ b/emis-biz/src/main/java/com/xdadan/erp/emis/service/warehouse/DocUtils.java @@ -57,16 +57,18 @@ public class DocUtils { * @throws Exception */ public static void wordToPdf(InputStream wordInput, OutputStream pdfOutput) throws Exception { - getLicense(); +// getLicense(); //通过aspose-words.jar中的类转换文件 Document wordDoc = new Document(wordInput); FontSubstitutionWarningCollector callback = new FontSubstitutionWarningCollector(); wordDoc.setWarningCallback(callback); if(!StringUtils.isEmpty(SystemConfig.FONT_PATH)) { - FontSettings.setFontsFolder(SystemConfig.FONT_PATH, false); +// FontSettings.setFontsFolder(SystemConfig.FONT_PATH, false); + FontSettings.getDefaultInstance().setFontsFolder(SystemConfig.FONT_PATH, false); } - PdfSaveOptions pso = new PdfSaveOptions(); - wordDoc.save(pdfOutput, pso); +// PdfSaveOptions pso = new PdfSaveOptions(); +// wordDoc.save(pdfOutput, pso); + wordDoc.save(pdfOutput, SaveFormat.PDF); } @SneakyThrows