[]
PagePrintedEventArgs, PagePrintingEventArgsThis event data class supplies page-related information for print processing, including the 1-based page number of the current page and the total page count.
worksheet.getRange("A1:A96").setValue(1);
PdfSaveOptions options = new PdfSaveOptions();
options.getPagePrintingEvent().addListener(new EventHandler<PagePrintingEventArgs>() {
public void invoke(Object sender, PagePrintingEventArgs e) {
int pageNumber = e.getPageNumber();
int pageCount = e.getPageCount();
}
});
workbook.save(new ByteArrayOutputStream(), options);
final intfinal intThis value identifies the page currently being processed in the PagePrinting or PagePrinted event sequence.
worksheet.getRange("A1:A96").setValue(1);
PdfSaveOptions options = new PdfSaveOptions();
options.getPagePrintingEvent().addListener(new EventHandler<PagePrintingEventArgs>() {
public void invoke(Object sender, PagePrintingEventArgs e) {
int pageNumber = e.getPageNumber();
}
});
workbook.save(new ByteArrayOutputStream(), options);
This value represents the total page count for the print operation that raised the current PagePrintingEventArgs or PagePrintedEventArgs instance.
worksheet.getRange("A1:A96").setValue(1);
PdfSaveOptions options = new PdfSaveOptions();
options.getPagePrintingEvent().addListener(new EventHandler<PagePrintingEventArgs>() {
public void invoke(Object sender, PagePrintingEventArgs e) {
int pageCount = e.getPageCount();
}
});
workbook.save(new ByteArrayOutputStream(), options);