|
@@ -2835,19 +2835,19 @@ public class TaskController extends BladeController {
|
|
/*printSetup.setFitHeight((short) 1);
|
|
/*printSetup.setFitHeight((short) 1);
|
|
printSetup.setFitWidth((short) 1);*/
|
|
printSetup.setFitWidth((short) 1);*/
|
|
// 设置页边距,单位为厘米
|
|
// 设置页边距,单位为厘米
|
|
- printSetup.setPaperSize(PrintSetup.A4_PAPERSIZE);
|
|
|
|
-
|
|
|
|
|
|
+ // printSetup.setPaperSize(PrintSetup.A3_PAPERSIZE);
|
|
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
|
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
|
workbook.write(out);
|
|
workbook.write(out);
|
|
workbook.write(new FileOutputStream(rs.getExcelPath()));
|
|
workbook.write(new FileOutputStream(rs.getExcelPath()));
|
|
com.aspose.cells.Workbook wb = new com.aspose.cells.Workbook(new ByteArrayInputStream(out.toByteArray()));
|
|
com.aspose.cells.Workbook wb = new com.aspose.cells.Workbook(new ByteArrayInputStream(out.toByteArray()));
|
|
PageSetup pageSetup =wb.getWorksheets().get(0).getPageSetup();
|
|
PageSetup pageSetup =wb.getWorksheets().get(0).getPageSetup();
|
|
- pageSetup.setLeftMargin(0.5); // 左边距
|
|
|
|
|
|
+ /* pageSetup.setLeftMargin(0.5); // 左边距
|
|
pageSetup.setRightMargin(0.5); // 右边距
|
|
pageSetup.setRightMargin(0.5); // 右边距
|
|
pageSetup.setTopMargin(1.5); // 上边距
|
|
pageSetup.setTopMargin(1.5); // 上边距
|
|
pageSetup.setBottomMargin(1.5); // 下边距*/
|
|
pageSetup.setBottomMargin(1.5); // 下边距*/
|
|
pageSetup.setCenterHorizontally(true);
|
|
pageSetup.setCenterHorizontally(true);
|
|
pageSetup.setCenterVertically(true);
|
|
pageSetup.setCenterVertically(true);
|
|
|
|
+ pageSetup.setPaperSize(PrintSetup.A4_PAPERSIZE);
|
|
out.reset();
|
|
out.reset();
|
|
wb.save(out, SaveFormat.PDF);
|
|
wb.save(out, SaveFormat.PDF);
|
|
reader = new PdfReader(new ByteArrayInputStream(out.toByteArray()));
|
|
reader = new PdfReader(new ByteArrayInputStream(out.toByteArray()));
|