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

Default printer media is ignored

XMLWordPrintable

    • 2d
    • b24
    • x86
    • linux

        FULL PRODUCT VERSION :
        java version "1.6.0_26"
        Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
        Java HotSpot(TM) Server VM (build 20.1-b02, mixed mode)

        ADDITIONAL OS VERSION INFORMATION :
        Linux 2.6.35.13-92.fc14.i686.PAE #1 SMP i686 i686 i386 GNU/Linux

        EXTRA RELEVANT SYSTEM CONFIGURATION :
        cups-1.4.6-1.fc14.i686

        A DESCRIPTION OF THE PROBLEM :
        Regardless the default media setup in cups, java always uses the first media from ppd.

        I sniffered the IPP communication between cups and java:
        ...Dmedia-defaultiso_a3_297x420mmDmedia-supportediso_a4_210x297mmDiso_a3_297x420mmD...
        --> The default media is passed to java

        When debugging the IPPPrintService, the the defaultMediaIndex is 0 and the getAttMap contains only "media-default=media-default" (no valid media) which seems to be the problem.

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        1. Add cups printer (as default printer))
        2. Change default media size in cups to A3
        3. Run code-snippet (see below)

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        The default media size should be A3.
        ACTUAL -
        The default media is the first media.

        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------
        import javax.print.PrintService;
        import javax.print.PrintServiceLookup;
        import javax.print.attribute.standard.Media;


        public class TestPrinterDefaultMedia {

            public static void main(final String[] args) {
                final PrintService printService = PrintServiceLookup
                        .lookupDefaultPrintService();

                // should return iso-a3
                System.out.println(printService.getDefaultAttributeValue(Media.class));
            }
        }
        ---------- END SOURCE ----------

        CUSTOMER SUBMITTED WORKAROUND :
        Set default media at top position of media list in ppd file.

              jgodinez Jennifer Godinez (Inactive)
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: