Hello,
Thank you for your inquiry.
To implement the requirements you mentioned, please use the following code snippet:
- Code: Select all
Workbook workbook = new Workbook();
workbook.loadFromFile("Ex01_xxx.xlsx");
for (int i = 0; i < workbook.getWorksheets().getCount(); i++) {
Worksheet worksheet = workbook.getWorksheets().get(i);
worksheet.getPageSetup().setPaperSize(PaperSizeType.PaperA4);
worksheet.getPageSetup().setTopMargin(0.5);
worksheet.getPageSetup().setBottomMargin(0.5);
}
workbook.saveToFile("result.pdf", FileFormat.PDF);
If you encounter any issues or require further assistance while implementing this code, please feel free to reach out to us.
Sincerely,
Annika
E-iceblue support team