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

Printing on Dell 5310n only with draft quality settings possible

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 6u15
    • client-libs
    • 2d
    • x86
    • windows_xp

      FULL PRODUCT VERSION :
      java version "1.6.0_15"
      Java(TM) SE Runtime Environment (build 1.6.0_15-b03)
      Java HotSpot(TM) Client VM (build 14.1-b02, mixed mode, sharing)

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

      A DESCRIPTION OF THE PROBLEM :
      When setting normal quality in Dell 5310n printer driver, no pages come out of the printer. If "Print to file" is selected, the generated Postscript does not contain the data that is to be printed but only some headers. If th quality is set to "draft", printing is ok as is the generated PS.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Run the following program pasted below.

      Set printer quality to "normal" in Dell 5310n Driver dialog. Print.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Printout
      ACTUAL -
      No printout

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.awt.Color;
      import java.awt.Font;
      import java.awt.Graphics;
      import java.awt.Graphics2D;
      import java.awt.geom.Rectangle2D;
      import java.awt.print.PageFormat;
      import java.awt.print.Paper;
      import java.awt.print.Printable;
      import java.awt.print.PrinterException;
      import java.awt.print.PrinterJob;

      public class PrintableDemo implements Printable {
        public int print(Graphics g, PageFormat pf, int pageIndex) {
          if (pageIndex != 0)
            return NO_SUCH_PAGE;
          Graphics2D g2 = (Graphics2D) g;
          g2.setFont(new Font("Serif", Font.PLAIN, 36));
          g2.setPaint(Color.black);
          g2.drawString("Java Source and Support", 100, 100);
          Rectangle2D outline = new Rectangle2D.Double(pf.getImageableX(), pf
              .getImageableY(), pf.getImageableWidth(), pf
              .getImageableHeight());
          g2.draw(outline);
          return PAGE_EXISTS;
        }
        public static void main(String[] args) {
          PrinterJob pj = PrinterJob.getPrinterJob();

          PageFormat pf = pj.defaultPage();
          Paper paper = new Paper();
          double margin = 36; // half inch
          paper.setImageableArea(margin, margin, paper.getWidth() - margin * 2,
              paper.getHeight() - margin * 2);
          pf.setPaper(paper);

          pj.setPrintable(new PrintableDemo(), pf);
          if (pj.printDialog()) {
            try {
              pj.print();
            } catch (PrinterException e) {
              System.out.println(e);
            }
          }
        }
      }

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

      CUSTOMER SUBMITTED WORKAROUND :
      Set quality to "draft"

            psadhukhan Prasanta Sadhukhan
            igor Igor Nekrestyanov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: