Details
Description
PrinterJob printerJob = PrinterJob.createPrinterJob();
Printer printer = Printer.getDefaultPrinter();
PageLayout pageLayout = printer.createPageLayout(Paper.A4, PageOrientation.LANDSCAPE, Printer.MarginType.HARDWARE_MINIMUM);
All other margin types work fine.
Throws:
java.lang.IllegalArgumentException: Illegal parameters
at javafx.print.PageLayout.<init>(PageLayout.java:104)
at javafx.print.Printer.createPageLayout(Printer.java:302)
at wing.reports_new.print.PrintTestApp.start(PrintTestApp.java:74)
Relevant code in your code base:
PageLayout(Paper paper, PageOrientation orient,
double leftMargin, double rightMargin,
double topMargin, double bottomMargin) {
if (paper == null || orient == null ||
leftMargin < 0 || rightMargin < 0 ||
topMargin < 0 || bottomMargin < 0) {
here-> throw new IllegalArgumentException("Illegal parameters");
}
Printer printer = Printer.getDefaultPrinter();
PageLayout pageLayout = printer.createPageLayout(Paper.A4, PageOrientation.LANDSCAPE, Printer.MarginType.HARDWARE_MINIMUM);
All other margin types work fine.
Throws:
java.lang.IllegalArgumentException: Illegal parameters
at javafx.print.PageLayout.<init>(PageLayout.java:104)
at javafx.print.Printer.createPageLayout(Printer.java:302)
at wing.reports_new.print.PrintTestApp.start(PrintTestApp.java:74)
Relevant code in your code base:
PageLayout(Paper paper, PageOrientation orient,
double leftMargin, double rightMargin,
double topMargin, double bottomMargin) {
if (paper == null || orient == null ||
leftMargin < 0 || rightMargin < 0 ||
topMargin < 0 || bottomMargin < 0) {
here-> throw new IllegalArgumentException("Illegal parameters");
}
Attachments
Issue Links
- duplicates
-
JDK-8095759 [Printing] Cups - PageLayout, Printer.MarginType.HARDWARE_MINIMUM error
- Closed