In my javafx application, I use the JavaFX 8 print API to print the node, I get a problem with the print area, despite the fact that I installed pageLayout with A4 paper ... here is my code:
public static void printNode(final Node node) throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException {
Printer printer = Printer.getDefaultPrinter();
PageLayout pageLayout = printer.createPageLayout(Paper.A4, PageOrientation.PORTRAIT, 0,0,0,0 );
PrinterJob job = PrinterJob.createPrinterJob();
if (job != null && job.showPrintDialog(node.getScene().getWindow()) ) {
boolean success = job.printPage(pageLayout, node);
if (success) {
job.endJob();
}
}
And here is the snapshot of the node I want to print:

and this is what i get when i type node

source
share