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

Illegal parameters when creating PageLayout

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 8u40
    • Fix Version/s: 9
    • Component/s: javafx
    • Environment:

      OS X Yosemite 10.10.2

      java version "1.8.0_40"
      Java(TM) SE Runtime Environment (build 1.8.0_40-b25)
      Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)

      Description

      PrinterJob printerJob = PrinterJob.createPrinterJob();
      Printer printer = Printer.getDefaultPrinter();
      PageLayout pageLayout = printer.createPageLayout(Paper.A4, PageOrientation.LANDSCAPE, Printer.MarginType.HARDWARE_MINIMUM);

      Looks like RT-37215 was not fixed properly.

      In any case one should print which parameters fail. Also, the calling method, Printer.createPageLayout(), should check its values and never try to create a page with negative margins since it is making the calculations.

      The error is for an Epson AcuLaser C9300N.


      Exception in thread "JavaFX Application Thread" java.lang.IllegalArgumentException: Illegal parameters
      at javafx.print.PageLayout.<init>(PageLayout.java:104)
      at javafx.print.Printer.createPageLayout(Printer.java:307)
      at wing.reports_new.print.Print.lambda$createPageSupplier$2(Print.java:332)

        Attachments

          Activity

            People

            • Assignee:
              prr Philip Race
              Reporter:
              mgrev Mikael Grev
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported: