Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8087949

Defaults for page-setup dialog don't obey system settings

XMLWordPrintable

      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 Mac system preferences for printers define a default printer and a default paper size. When the page-setup dialog is created, the setting for the default printer seems to be obeyed but the setting for the paper size is always ignored and always set to US letter instead. This is a pain in regions of the world where US letter is not a valid option.

            prr Philip Race
            dpausjfx Dr. Michael Paus (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Imported: