可以的把,我加载的json数据,最后保存为pdf,实现了啊
- Workbook workbook = new Workbook();
- workbook.setEnableCalculation(true);
- JSONObject jsonObject = new JSONObject(map);
- String json = jsonObject.toString();
- workbook.fromJson(json);
- if (workbook.getWorksheets().get("0538HI") != null) {
- workbook.getWorksheets().get("0538HI").getPageSetup().setFitToPagesWide(1);
- workbook.getWorksheets().get("0538HI").getPageSetup().setIsPercentScale(false);
- }
- java.io.ByteArrayOutputStream out = new ByteArrayOutputStream();
- workbook.save(out, SaveFileFormat.Pdf);
复制代码 |