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

Illegal parameters when creating PageLayout

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 9
    • 8u40
    • javafx
    • 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)

      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)

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

              Created:
              Updated:
              Resolved:
              Imported: