Page-setup settings are ignored when printing WebView

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P3
    • tbd
    • Affects Version/s: 8, 9
    • Component/s: javafx
    • Environment:

      MacOS 10.10.3, Retina MacBook Pro

      I try to print the content of a WebView with the following code:

          private void handlePrintButtonAction(ActionEvent event) {
              PrinterJob job = PrinterJob.createPrinterJob();
              if (job != null) {
                  Window window = webView.getScene() != null ? webView.getScene().getWindow() : null;
                  if (job.showPageSetupDialog(window)) {
                      if (job.showPrintDialog(window)) {
                          webView.getEngine().print(job);
                          job.endJob();
                      }
                  }
              }
          }

      The page-setup dialog offers the option to define a scale factor at which the page should be printed. This setting is consistently ignored by the JavaFX WebView. When I print the same page via Firefox, which provides exactly the same dialog for setting the scale factor, it works as expected and a scaled version of the page content is printed. I expect JavaFX to do the same.

            Assignee:
            Philip Race
            Reporter:
            Dr. Michael Paus (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Imported: