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

JavaFX printing on Mac OS X produces unreadable text output

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P4
    • 9
    • 8u45
    • javafx
    • x86
    • os_x

    Description

      FULL PRODUCT VERSION :
      java version "1.8.0_45"
      Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
      Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Darwin MBP-van-Peter 14.3.0 Darwin Kernel Version 14.3.0: Mon Mar 23 11:59:05 PDT 2015; root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64

      A DESCRIPTION OF THE PROBLEM :
      Printing text on a mac via JavaFx produces unreadable text. The same code on ms windows works ok

      ADDITIONAL REGRESSION INFORMATION:
      java version "1.8.0_45"
      Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
      Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      run the test-code

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Correct text output ("Test of text print"). Instead garbage comes out.
      ACTUAL -
      complete unreadable text

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------

      import javafx.application.Application;
      import javafx.print.Printer;
      import javafx.print.PrinterJob;
      import javafx.scene.text.Text;
      import javafx.stage.Stage;

      public class JavaFxPrint extends Application {


      public JavaFxPrint() {
      Printer printer = Printer.getDefaultPrinter();
      Text text = new Text("Test of text print");
      text.layoutYProperty().set(150);
      text.prefWidth(300);
      text.prefHeight(150);
      PrinterJob job = PrinterJob.createPrinterJob(printer);

      boolean success = job.printPage(text);
      if (success) {
      job.endJob();
      }
      }

      public static void main(String[] args) {
      launch(args);

      }

      @Override
      public void start(Stage arg0) throws Exception {
      JavaFxPrint print = new JavaFxPrint();
      }
      }

      ---------- END SOURCE ----------

      Attachments

        Issue Links

          Activity

            People

              prr Philip Race
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: