liding
3 小时以前 86b1093e1082ac950408765e0f70c03c741d5f5a
cnas-manage/src/main/java/com/ruoyi/manage/service/impl/ManageDocumentListServiceImpl.java
@@ -36,7 +36,7 @@
 * 服务实现类
 * </p>
 *
 * @author 芯导软件(江苏)有限公司
 * @author
 * @since 2024-11-08 11:08:11
 */
@Service
@@ -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;
    }
}