许鹏程
2023-06-09 15e225d692605505d549764e2071770e8686f8c3
excel 转pdf
已修改1个文件
8 ■■■■ 文件已修改
src/main/java/com/product/file/util/AsposeUtil.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/product/file/util/AsposeUtil.java
@@ -71,8 +71,11 @@
        FileOutputStream fileOS=null;
        try {
            File file = new File(OutPutPath);
            if (!file.exists()) {
                file.mkdirs();
            if(!file.getParentFile().exists()){
                file.getParentFile().mkdirs();
            }
            if (!file.isFile()) {
                file.createNewFile();
            }
            Workbook wb = new Workbook(officePath);// 原始excel路径
            File pdfFile = new File(OutPutPath);// 输出路径
@@ -82,6 +85,7 @@
            pdfSaveOptions.setAllColumnsInOnePagePerSheet(true);
            wb.save(fileOS, pdfSaveOptions);
        } catch (Exception e) {
            e.printStackTrace();
            throw new BaseException(e);
        }finally{
            if(fileOS!=null) {