[]
PdfSaveOptions.getPagePrintingEvent() 事件提供数据。使用此事件数据类可以检查正在处理的页面,并通过 setSkipThisPage(boolean) 确定是否应从输出中跳过当前页面。
worksheet.getRange("A1:A96").setValue(1);
PdfSaveOptions options = new PdfSaveOptions();
options.getPagePrintingEvent().addListener(new EventHandler<PagePrintingEventArgs>() {
public void invoke(Object sender, PagePrintingEventArgs e) {
if (e.getPageNumber() == 2) {
e.setSkipThisPage(true);
}
}
});
workbook.save(new ByteArrayOutputStream(), options);
final booleanfinal voidsetSkipThisPage(boolean value) getPageCount, getPageNumber此属性通常在 PagePrinting 事件中使用,用于确定导出或打印时是否省略该页面。
worksheet.getRange("A1:A96").setValue(1);
PdfSaveOptions options = new PdfSaveOptions();
options.getPagePrintingEvent().addListener(new EventHandler<PagePrintingEventArgs>() {
public void invoke(Object sender, PagePrintingEventArgs e) {
if (e.getPageNumber() == 2) {
e.setSkipThisPage(true);
boolean skipThisPage = e.getSkipThisPage();
}
}
});
workbook.save(new ByteArrayOutputStream(), options);
true;否则为 false。此属性通常在 PagePrinting 事件中使用,用于确定导出或打印时是否省略该页面。
worksheet.getRange("A1:A96").setValue(1);
PdfSaveOptions options = new PdfSaveOptions();
options.getPagePrintingEvent().addListener(new EventHandler<PagePrintingEventArgs>() {
public void invoke(Object sender, PagePrintingEventArgs e) {
if (e.getPageNumber() == 2) {
e.setSkipThisPage(true);
}
}
});
workbook.save(new ByteArrayOutputStream(), options);
value - 如果应在输出中跳过当前页面,则为 true;否则为 false。