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

print() method of DocPrintJob throws ClassCastException for Media attributes

XMLWordPrintable

    • 2d
    • beta2
    • sparc
    • solaris
    • Verified


      print() method of DocPrintJob throws ClassCastException for some of the Media
      attributes that are added to the HashPrintRequestAttributeSet.
      Attached is a sample program and a gif file that the testcase tries to print using the Media attributes.
      A media attribute(MediaName or MediaTray or MediaSizeName) is added to the HashPrintRequestAttribute and passed on to DocPrintJob for printing

      The testcase when run throws the following exception:
      java.lang.ClassCastException: javax.print.attribute.standard.MediaName
               at sun.print.UnixPrintJob.getAttributeValues(UnixPrintJob.java:670)
               at sun.print.UnixPrintJob.print(UnixPrintJob.java:301)
               at MediaTest.printImage(MediaTest.java:166)
               at MediaTest.<init>(MediaTest.java:34)
               at MediaTest.main(MediaTest.java:176)
       
      Source: MediaTest.java
      Resource: TopLogo.gif

            jgodinez Jennifer Godinez (Inactive)
            kbalasubsunw Kannan Balasubramanian (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: