title: Printing node on multiple pages
body: <p>I have a table view that can't fit on one page but when I print it only one page gets printed. What should I do so that the rest of the table is printed on other pages?</p>
  
  <p>Sample code below that fills a table view with 50 rows and prints it (I use foxit as a pdf printer, amend as required). The output pdf only contains one page that ends around row 30 although the TableView shows more than 45 rows.</p>
  
  <pre><code>public class FXPrint extends Application {
      public static void main(String[] args) { launch(FXPrint.class); }
  
      @Override
      public void start(Stage stage) throws Exception {
          TableView&lt;String&gt; table = new TableView&lt;&gt;();
          for (int i = 0; i &lt; 25; i++) {
              TableColumn&lt;String, String&gt; tc = new TableColumn&lt;&gt;("" + i);
              int index = i;
              tc.setCellValueFactory(param -&gt; {
                  String s = param.getValue();
                  if (s.length() &lt;= index) return new SimpleStringProperty();
                  else return new SimpleStringProperty(s.substring(index, index + 1));
              });
              table.getColumns().add(tc);
          }
          for (int i = 0; i &lt; 50; i++) table.getItems().add(i + "sdfghjklrthyjkcasdghasfdsfgdfgsdfggfdg");
  
          Button print =  new Button("print");
          print.setOnAction(e -&gt; print(table));
  
          VBox box = new VBox(10, table, print);
          VBox.setVgrow(table, Priority.ALWAYS);
          stage.setScene(new Scene(box));
          stage.setWidth(600);
          stage.setHeight(1200);
          stage.show();
      }
  
      public void print(final TableView&lt;?&gt; table) {
          Printer printer = Printer.getAllPrinters().stream().filter(p -&gt; p.getName().contains("Foxit")).findAny().get();
          PageLayout pageLayout = printer.createPageLayout(Paper.A4, PageOrientation.PORTRAIT, Printer.MarginType.DEFAULT);
  
          PrinterJob job = PrinterJob.createPrinterJob(printer);
          if (job != null) {
              job.getJobSettings().setPageLayout(pageLayout);
              if (job.printPage(table)) {
                  job.endJob();
              }
          }
      }
  }
  </code></pre>