| | |
| | | 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);// 输出路径 |
| | |
| | | pdfSaveOptions.setAllColumnsInOnePagePerSheet(true); |
| | | wb.save(fileOS, pdfSaveOptions); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | throw new BaseException(e); |
| | | }finally{ |
| | | if(fileOS!=null) { |