Hello All.
I'm having a strange problem when I try to print through the following JavaFx code
The problem is that on my Mac, if I try to print the paneContenitoreBolletta, all characters are printed in the wrong way: it seems the encoding character is wrong. But if i try on a Windows pc the print works properly.
I suppose the problem is due to the jvm. Does anyone know how can I resolve this issue?
Printer printer = Printer.getDefaultPrinter();
PageLayout pageLayout = printer.createPageLayout(Paper.A4, PageOrientation.PORTRAIT, Printer.MarginType.DEFAULT);
double scaleX = pageLayout.getPrintableWidth() / paneContenitore.getPrefWidth();
double scaleY = (pageLayout.getPrintableHeight() / paneContenitore.getPrefHeight())
* (paneContenitore.getPrefHeight() / paneContenitore.getPrefWidth());
paneContenitore.getTransforms().add(new Scale(scaleX, scaleX));
PrinterJob job = PrinterJob.createPrinterJob();
if(job.showPrintDialog(Main.getInstance().myStage.getOwner()) && job.printPage(labelCondominio))
job.endJob();
I'm having a strange problem when I try to print through the following JavaFx code
The problem is that on my Mac, if I try to print the paneContenitoreBolletta, all characters are printed in the wrong way: it seems the encoding character is wrong. But if i try on a Windows pc the print works properly.
I suppose the problem is due to the jvm. Does anyone know how can I resolve this issue?
Printer printer = Printer.getDefaultPrinter();
PageLayout pageLayout = printer.createPageLayout(Paper.A4, PageOrientation.PORTRAIT, Printer.MarginType.DEFAULT);
double scaleX = pageLayout.getPrintableWidth() / paneContenitore.getPrefWidth();
double scaleY = (pageLayout.getPrintableHeight() / paneContenitore.getPrefHeight())
* (paneContenitore.getPrefHeight() / paneContenitore.getPrefWidth());
paneContenitore.getTransforms().add(new Scale(scaleX, scaleX));
PrinterJob job = PrinterJob.createPrinterJob();
if(job.showPrintDialog(Main.getInstance().myStage.getOwner()) && job.printPage(labelCondominio))
job.endJob();
- duplicates
-
JDK-8094840 [Printing] TextFlow. Printed page looks incorrect
-
- Closed
-