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

On Linux, only the default media size appears as an option in the print dialog

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P3 P3
    • 9
    • 6u10
    • client-libs
    • 2d
    • x86
    • linux

      FULL PRODUCT VERSION :
      Reported with both Java 1.6.0_04 and with JDK 1.6.0_17-b04 (Java HotSpot Server VM, build 14.3-b01, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Reported on both glnx86 and glnxa64.

      First computer-- glnx86 machine running KDE, JDK 1.6.0_17, with CUPS printing

      Second computer-- Operating System: Linux 2.6.9-89.16.ELsmp #1 SMP Fri Nov 13 16:03:32 EST 2009 x86_64 Java VM Version: Java 1.6.0_04 with Sun Microsystems Inc. Java HotSpot(TM) 64-Bit Server VM mixed mode, using CUPS printing and RedHat

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      This is the CUPS configuration information for the 2nd computer (glnxa4):

      PRINTERS.conf file contents:

      # Printer configuration file for CUPS v1.1.22rc1
      # Written by cupsd on Mon 15 Mar 2010 11:39:15 AM CET
      <DefaultPrinter e7sfp-p1168>
      Info Created by redhat-config-printer 0.6.x
      DeviceURI lpd://fsps1a5a/e7sfp-p1168
      Location
      State Idle
      Accepting Yes
      JobSheets none none
      QuotaPeriod 0
      PageLimit 0
      KLimit 0
      </Printer>
      <Printer finp782>
      Info Created by redhat-config-printer 0.6.x
      DeviceURI lpd://fsps1a5a/finp782
      State Idle
      Accepting Yes
      JobSheets none none
      QuotaPeriod 0
      PageLimit 0
      KLimit 0
      </Printer>
      <Printer w70fp-p1006>
      Info Created by redhat-config-printer 0.6.x
      DeviceURI lpd://fsps1a5a/w70fp-p1006
      State Idle
      Accepting Yes
      JobSheets none none
      QuotaPeriod 0
      PageLimit 0
      KLimit 0
      </Printer>
      <Printer w70fp-p1012>
      Info Created by redhat-config-printer 0.6.x
      DeviceURI lpd://fsps1a5a/w70fp-p1012
      Location
      State Idle
      Accepting Yes
      JobSheets none none
      QuotaPeriod 0
      PageLimit 0
      KLimit 0
      </Printer>
      <Printer w70fp-p1024>
      Info Created by redhat-config-printer 0.6.x
      DeviceURI lpd://fsps1a5a/w70fp-p1024
      State Idle
      Accepting Yes
      JobSheets none none
      QuotaPeriod 0
      PageLimit 0
      KLimit 0
      </Printer>
      <Printer w70fp-p1044>
      Info Created by redhat-config-printer 0.6.x
      DeviceURI lpd://fsps1a5a/w70fp-p1044
      State Idle
      Accepting Yes
      JobSheets none none
      QuotaPeriod 0
      PageLimit 0
      KLimit 0
      </Printer>
      <Printer w70fp-p1048>
      Info Created by redhat-config-printer 0.6.x
      DeviceURI lpd://fsps1a5a/w70fp-p1048
      State Idle
      Accepting Yes
      JobSheets none none
      QuotaPeriod 0
      PageLimit 0
      KLimit 0
      </Printer>
      <Printer w70fp-p1069>
      Info Created by redhat-config-printer 0.6.x
      DeviceURI lpd://fsps1a5a/w70fp-p1069
      State Idle
      Accepting Yes
      JobSheets none none
      QuotaPeriod 0
      PageLimit 0
      KLimit 0
      </Printer>
      <Printer w70fp-p1081>
      Info Created by redhat-config-printer 0.6.x
      DeviceURI lpd://fsps1a5a/w70fp-p1081
      State Idle
      Accepting Yes
      JobSheets none none
      QuotaPeriod 0
      PageLimit 0
      KLimit 0
      </Printer>
      <Printer w70fp-p1091>
      Info Created by redhat-config-printer 0.6.x
      DeviceURI lpd://fsps1a5a/w70fp-p1091
      State Idle
      Accepting Yes
      JobSheets none none
      QuotaPeriod 0
      PageLimit 0
      KLimit 0
      </Printer>
      <Printer w70fp-p965>
      Info Created by redhat-config-printer 0.6.x
      DeviceURI lpd://fsps1a5a/w70fp-p965
      State Idle
      Accepting Yes
      JobSheets none none
      QuotaPeriod 0
      PageLimit 0
      KLimit 0
      </Printer>


      A DESCRIPTION OF THE PROBLEM :
      When I use the ServiceUI.printDialog command on Linux, the only media size option I am seeing (for any printer on our network) is the system default, "Letter". When the same printers are accessed from other, non-Java applications on my computer, I can pick from a variety of media sizes. This issue is also not present on Windows.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Run the attached source code and view the media size options for various printers.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      I expect to be able to select common media sizes that are not my system default (for example, A4).
      ACTUAL -
      Only the default media size ("Letter" on my system) appears.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import javax.print.DocFlavor;
      import javax.print.PrintService;
      import javax.print.PrintServiceLookup;
      import javax.print.ServiceUI;
      import javax.print.attribute.HashPrintRequestAttributeSet;
      import javax.print.attribute.PrintRequestAttributeSet;

      public class PrintTest {
          public static void showDialog() {
              PrintRequestAttributeSet pras = new HashPrintRequestAttributeSet();
              DocFlavor flavor = DocFlavor.SERVICE_FORMATTED.PRINTABLE;
              PrintService[] printServices = PrintServiceLookup.lookupPrintServices(flavor, pras);
              ServiceUI.printDialog(null, 400, 400, printServices, printServices[0], flavor, pras);
          }

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

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

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: