[]
        
(Showing Draft Content)

PagePrintedEventArgs

Class PagePrintedEventArgs


public class PagePrintedEventArgs extends PagePrintEventArgs
Provides data for the PagePrinted event.

Use this event data to inspect page information after a page has been printed and to request whether additional pages should continue to print.


 worksheet.getRange("A1:A96").setValue(1);
 final boolean[] hasMorePages = new boolean[] { false };
 PdfSaveOptions options = new PdfSaveOptions();
 options.getPagePrintedEvent().addListener(new EventHandler<PagePrintedEventArgs>() {
     public void invoke(Object sender, PagePrintedEventArgs e) {
         hasMorePages[0] |= e.getHasMorePages();
     }
 });
 workbook.save(new ByteArrayOutputStream(), options);
 
  • Constructor Details

    • PagePrintedEventArgs

      public PagePrintedEventArgs()
  • Method Details

    • getHasMorePages

      public final boolean getHasMorePages()
      Gets a value indicating whether an additional page should be printed.

      If this method returns true during the PagePrinted event, you can call setHasMorePages(boolean) with false to stop printing more pages. If this method returns false, setting that property has no effect.

      
       worksheet.getRange("A1:A96").setValue(1);
       final boolean[] hasMorePages = new boolean[] { false };
       PdfSaveOptions options = new PdfSaveOptions();
       options.getPagePrintedEvent().addListener(new EventHandler<PagePrintedEventArgs>() {
           public void invoke(Object sender, PagePrintedEventArgs e) {
               hasMorePages[0] |= e.getHasMorePages();
           }
       });
       workbook.save(new ByteArrayOutputStream(), options);
       
      Returns:
      true if an additional page should be printed; otherwise, false.
    • setHasMorePages

      public final void setHasMorePages(boolean value)
      Sets a value indicating whether an additional page should be printed.
      
       worksheet.getRange("A1:A96").setValue(1);
       PdfSaveOptions options = new PdfSaveOptions();
       options.getPagePrintedEvent().addListener(new EventHandler<PagePrintedEventArgs>() {
           public void invoke(Object sender, PagePrintedEventArgs e) {
               e.setHasMorePages(false);
           }
       });
       workbook.save(new ByteArrayOutputStream(), options);
       
      Parameters:
      value - true if an additional page should be printed; otherwise, false.