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

Letters and graphics on HP Laserjet Printer are much too large with jdk 1.4

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.0
    • 1.4.0
    • client-libs
    • 2d
    • rc1
    • x86
    • windows_nt



      Name: yyT116575 Date: 09/05/2001


      java version "1.4.0-beta2"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta2-b77)
      Java HotSpot(TM) Client VM (build 1.4.0-beta2-b77, mixed mode)


      I printed a page on a HP LaserJet 5 from an application, which works
      fine using jdk 1.3.1. But when I'm using 1.4.0-Beta 2, all letters
      and lines are much bigger. It is 4 times the size of the letters
      and lines using jdk 1.3.1.

      The following is the test program that reproduce the different results.

      import javax.swing.*;
      import java.awt.Graphics;
      import java.awt.FontMetrics;

      class ArbeitDrucken extends JFrame {

        static String schrifttyp = "SansSerif";
        static int schriftgroesse = 10;
        static int rechterRand = 560;
        static final java.awt.Font font = new java.awt.Font(schrifttyp,java.awt.Font.PLAIN,schriftgroesse);
        static JFrame jframe;

        static void Ueberschrift(Graphics graphics, String ueberschriftDruck) {
          graphics.drawString(ueberschriftDruck, 50, 140);
          graphics.drawLine(47,125,rechterRand+3,125);
          graphics.drawLine(47,145,rechterRand+3,145);
          graphics.drawLine(47,125,47,145);
          graphics.drawLine(rechterRand+3,125,rechterRand+3,145);
        }

        static void Drucken(JFrame jframe) {
          java.awt.Toolkit toolkit = java.awt.Toolkit.getDefaultToolkit();
          java.util.Properties properties = new java.util.Properties();
          java.awt.PrintJob printjob = toolkit.getPrintJob(jframe,"Drucken",properties);
          Graphics graphics = printjob.getGraphics();
          FontMetrics fontmetrics = graphics.getFontMetrics(font);
          graphics.setFont(font);
          Ueberschrift(graphics, "This is a test");
          graphics.dispose();
          printjob.end();
        }

        public static void main(String args[]) {
          jframe = new JFrame();
          Drucken(jframe);
        }

      }

      Problem occurs on german Windows NT 4.0 SP 5 with
      HP LaserJet 5 and also on german Windows 95 with
      HP LaserJet 5P.

      Three-page result is included in an attached file. They were printed
      on A4-sized-paper and scanned with 300 dpi as tiff-files.
      (Review ID: 130934)
      ======================================================================

            jgodinez Jennifer Godinez (Inactive)
            yyoungsunw Yung-ching Young (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: