< prev index next >

src/java.desktop/share/classes/sun/print/RasterPrinterJob.java

Print this page

        

@@ -1474,10 +1474,22 @@
         if ((psvc.getAttribute(PrinterIsAcceptingJobs.class)) ==
                          PrinterIsAcceptingJobs.NOT_ACCEPTING_JOBS) {
             throw new PrinterException("Printer is not accepting job.");
         }
 
+        /*
+         * Check the default job-sheet value on underlying platform. If IPP
+         * reports job-sheets=none, then honour that and reset noJobSheet since
+         * by default, noJobSheet is false which mean jdk will print banner page.
+         * We do this before setAttributes() as user can override this by enabling
+         * printing Banner page through print dialog via setAttributes().
+         */
+        JobSheets js = (JobSheets)psvc.getDefaultAttributeValue(JobSheets.class);
+        if (js != null && js.equals(JobSheets.NONE)) {
+            noJobSheet = true;
+        }
+        
         if ((psvc instanceof SunPrinterJobService) &&
             ((SunPrinterJobService)psvc).usesClass(getClass())) {
             setAttributes(attributes);
             // throw exception for invalid destination
             if (destinationAttr != null) {
< prev index next >