-
Bug
-
Resolution: Unresolved
-
P3
-
8, 9
-
MacOS 10.10.3, Retina MacBook Pro
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.
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.