// Create a new workbook Workbook workbook = new Workbook(); IWorksheet worksheet = workbook.getWorksheets().get(0); worksheet.getRange("J12").setValue(1); // Set the view mode of the worksheet to PageBreakPreview. worksheet.getSheetView().setViewType(ViewType.PageBreakPreview); // Modify the zoom of the PageBreakPreview to 80%. worksheet.getSheetView().setZoom(80); // Save to an excel file workbook.save("ConfigPageBreakPreview.xlsx");