At least on Windows, an IllegalArgumentException is thrown when printing with margins equal to 0.
Caused by: java.lang.IllegalArgumentException: Margins must be >= 0
at javafx.print.Printer.createPageLayout(Printer.java:359) ~[javafx-graphics-19.0.0-CZM-01-win.jar:?]
at com.sun.prism.j2d.print.J2DPrinterJob.updatePageLayout(J2DPrinterJob.java:519) ~[javafx-graphics-19.0.0-CZM-01-win.jar:?]
at com.sun.prism.j2d.print.J2DPrinterJob.updateSettingsFromDialog(J2DPrinterJob.java:600) ~[javafx-graphics-19.0.0-CZM-01-win.jar:?]
at com.sun.prism.j2d.print.J2DPrinterJob.showPageDialog(J2DPrinterJob.java:296) ~[javafx-graphics-19.0.0-CZM-01-win.jar:?]
at javafx.print.PrinterJob.showPageSetupDialog(PrinterJob.java:337) ~[javafx-graphics-19.0.0-CZM-01-win.jar:?]
at com.zeiss.forum.viewer.feature.actions.print.pdf.ImagePrintFx.print(ImagePrintFx.java:122) ~[classes/:?]
... 62 more
Caused by: java.lang.IllegalArgumentException: Margins must be >= 0
at javafx.print.Printer.createPageLayout(Printer.java:359) ~[javafx-graphics-19.0.0-CZM-01-win.jar:?]
at com.sun.prism.j2d.print.J2DPrinterJob.updatePageLayout(J2DPrinterJob.java:519) ~[javafx-graphics-19.0.0-CZM-01-win.jar:?]
at com.sun.prism.j2d.print.J2DPrinterJob.updateSettingsFromDialog(J2DPrinterJob.java:600) ~[javafx-graphics-19.0.0-CZM-01-win.jar:?]
at com.sun.prism.j2d.print.J2DPrinterJob.showPageDialog(J2DPrinterJob.java:296) ~[javafx-graphics-19.0.0-CZM-01-win.jar:?]
at javafx.print.PrinterJob.showPageSetupDialog(PrinterJob.java:337) ~[javafx-graphics-19.0.0-CZM-01-win.jar:?]
at com.zeiss.forum.viewer.feature.actions.print.pdf.ImagePrintFx.print(ImagePrintFx.java:122) ~[classes/:?]
... 62 more