zhuo
2025-02-28 bb120c51ecba1bb4a16224352a6e8f620fdff79f
cnas-manage/src/main/java/com/ruoyi/manage/service/impl/ManageDocumentListServiceImpl.java
@@ -95,33 +95,4 @@
        saveBatch(list);
    }
    public String wordToPdf(String wordPath, String pdfPath) {
        FileOutputStream os = null;
        try {
            InputStream is = new ClassPathResource("/lib/license.xml").getInputStream();
            License license = new License();
            license.setLicense(is);
            if (!license.getIsLicensed()) {
                System.out.println("License验证不通过...");
                return null;
            }
            //生成一个空的PDF文件
            File file = new File(pdfPath.replace(".pdf", ".pdf"));
            os = new FileOutputStream(file);
            //要转换的word文件
            com.aspose.words.Document doc = new com.aspose.words.Document(wordPath);
            doc.save(os, SaveFormat.PDF);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (os != null) {
                try {
                    os.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
        return null;
    }
}