我正在尝试打印" www.google.com"但, 打印不包括背景图像,它只打印文本,我如何包含它?
守则,
public void print() {
logger.info("Print Event - Message: " + "Iniciando Impressora");
ChoiceDialog dialog = new ChoiceDialog(Printer.getDefaultPrinter(), Printer.getAllPrinters());
dialog.setTitle("Escolha uma Impressora!");
dialog.setHeaderText("Confirme a escolha de uma impressora!");
Optional<Printer> opt = dialog.showAndWait();
if (opt.isPresent()) {
Printer p = opt.get();
PageLayout pageLayout = p.createPageLayout(Paper.A4, PageOrientation.PORTRAIT, Printer.MarginType.DEFAULT);
PrinterJob job = PrinterJob.createPrinterJob(p);
webEngine.print(job);
job.endJob();
}
}
我也需要打印背景图像。 提前谢谢。