JavaFx: webview print with scale 100%

Anton V. Tarasov anton.tarasov at oracle.com
Fri Jun 19 14:03:19 UTC 2015


Hi Alexander,

Could you please create and send a simple test case (fully functioning) with the exact URL of a page 
you're printing?

Regards,
Anotn.

On 15.06.2015 8:53, Александр Свиридов wrote:
> To print my html page I use the following code:
> PrinterJob job =PrinterJob.createPrinterJob();if(job !=null&& job.showPrintDialog(null)){
>        webView.getEngine().print(job);
>        job.endJob();}
> The problem is that webview changes the scale of printing page. For example, when I print this html page in IE with fit to size 100% I get 16.8 cm. When I print in my java application I get 11.4cm. The size in html file I set in pt - my width is 475pt(A4 width=595pt,so 475pt=16.8cm). How to print with webview and to have 100% width and height?



More information about the openjfx-dev mailing list