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

Empty pages when printing on Lexmark E352dn PS3 with "1200 IQ" setting

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • 6u10
    • client-libs
    • 2d
    • b127
    • x86
    • windows_xp

      FULL PRODUCT VERSION :
      java version "1.6.0_18"
      Java(TM) SE Runtime Environment (build 1.6.0_18-b07)
      Java HotSpot(TM) Client VM (build 16.0-b13, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [Version 5.1.2600]

      A DESCRIPTION OF THE PROBLEM :
      Printing from any Java application on a Lexmark E352dn PS3 with an image setting of "1200 IQ" produces empty pages. Printing with "600 dpi" or "1200 dpi" works fine, but the "Image Quality (IQ)" modes don't.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Install the Microsft certified printer driver Lexmark_ABK_2KXP03_x86_PS_sys_de.exe

      2. Run the HelloWorlPrinter example from the tutorial

      3. Compile and run the application. When printing select the "Lexmark E352dn PS3" printer. Redirect output to a file named "xxx.ps". Make sure to set the image quality to "1200 IQ".




      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Viewing this file with a psoscript viewer should display a page with the text "Hello world!"
      ACTUAL -
      The page is empty, no text is displayed.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.awt.Graphics;
      import java.awt.Graphics2D;
      import java.awt.event.ActionEvent;
      import java.awt.event.ActionListener;
      import java.awt.event.WindowAdapter;
      import java.awt.event.WindowEvent;
      import java.awt.print.PageFormat;
      import java.awt.print.Printable;
      import java.awt.print.PrinterException;
      import java.awt.print.PrinterJob;
      import javax.print.attribute.PrintRequestAttributeSet;
      import javax.print.attribute.HashPrintRequestAttributeSet;
      import javax.print.attribute.standard.PrinterResolution;

      import javax.swing.JButton;
      import javax.swing.JFrame;
      import javax.swing.UIManager;

      public class HelloWorldPrinter implements Printable, ActionListener {


          public int print(Graphics g, PageFormat pf, int page) throws
                                                              PrinterException {

              if (page > 0) { /* We have only one page, and 'page' is zero-based */
                  return NO_SUCH_PAGE;
              }

              /* User (0,0) is typically outside the imageable area, so we must
               * translate by the X and Y values in the PageFormat to avoid clipping
               */
              Graphics2D g2d = (Graphics2D)g;
              g2d.translate(pf.getImageableX(), pf.getImageableY());

              /* Now we perform our rendering */
              g.drawString("Hello world!", 100, 100);

              /* tell the caller that this page is part of the printed document */
              return PAGE_EXISTS;
          }

          public void actionPerformed(ActionEvent e) {
               PrinterJob job = PrinterJob.getPrinterJob();
               job.setPrintable(this);
               boolean ok = job.printDialog();
               if (ok) {
                   try {
                        job.print();
                   } catch (PrinterException ex) {
                    /* The job did not successfully complete */
                   }
               }
          }

          public static void main(String args[]) {
       
              UIManager.put("swing.boldMetal", Boolean.FALSE);
              JFrame f = new JFrame("Hello World Printer");
              f.addWindowListener(new WindowAdapter() {
                 public void windowClosing(WindowEvent e) {System.exit(0);}
              });
              JButton printButton = new JButton("Print Hello World");
              printButton.addActionListener(new HelloWorldPrinter());
              f.add("Center", printButton);
              f.pack();
              f.setVisible(true);
          }
      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Printing with "600 dpi" or "1200 dpi" works fine.

            psadhukhan Prasanta Sadhukhan
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: