[]
        
(Showing Draft Content)

PagePrintingEventArgs

Class PagePrintingEventArgs


public class PagePrintingEventArgs extends PagePrintEventArgs
Provides data for the PdfSaveOptions.getPagePrintingEvent() event.

Use this event data class to inspect the page being processed and determine whether the current page should be skipped from the output through 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);
 
  • Constructor Details

    • PagePrintingEventArgs

      public PagePrintingEventArgs()
  • Method Details

    • getSkipThisPage

      public final boolean getSkipThisPage()
      Gets a value indicating whether the current page should be skipped in output.

      This property is typically used in the PagePrinting event to determine whether the page will be omitted when exporting or printing.

      
       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);
       
      Returns:
      true if the current page should be skipped in output; otherwise, false.
    • setSkipThisPage

      public final void setSkipThisPage(boolean value)
      Sets a value indicating whether the current page should be skipped in output.

      This property is typically used in the PagePrinting event to determine whether the page will be omitted when exporting or printing.

      
       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);
       
      Parameters:
      value - true if the current page should be skipped in output; otherwise, false.