Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8094573

Problems during the printing

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • 9
    • 8u25
    • javafx
    • None

      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();

            prr Philip Race
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: