// Create a new workbook Workbook workbook = new Workbook(); IWorksheet sheet = workbook.getWorksheets().get(0); sheet.getRange("A1:B5").setValue(new Object[][] { {1, 2}, {3, 4}, {5, 6}, {7, 8}, {9, 10} }); //Add page break sheet.getHPageBreaks().add(sheet.getRange("B3")); sheet.getVPageBreaks().add(sheet.getRange("B3")); // Save to a pdf file workbook.save("ConfigurePageBreaks.pdf");