United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-8012381 [macosx] : Collation selection ignored when printing on MacOSX
JDK-8012381 : [macosx] : Collation selection ignored when printing on MacOSX

Details
Type:
Bug
Submit Date:
2013-04-16
Status:
Resolved
Updated Date:
2013-12-17
Project Name:
JDK
Resolved Date:
2013-06-03
Component:
client-libs
OS:
Sub-Component:
2d
CPU:
Priority:
P3
Resolution:
Fixed
Affected Versions:
8
Fixed Versions:
7u40 (b30)

Related Reports
Backport:
Backport:
Backport:

Sub Tasks

Description
Run the following test on Mac. When the print dialog comes up select "Paper Handling"
from the menu and check "Collate Page" and print. Pages still print uncollated.

import java.awt.*;
import javax.swing.*;
import java.awt.print.*;
import javax.print.attribute.PrintRequestAttributeSet;
import javax.print.attribute.HashPrintRequestAttributeSet;
import javax.print.attribute.standard.DialogTypeSelection;
import javax.print.attribute.standard.SheetCollate;
import javax.print.attribute.standard.Copies;

public class SunTest implements Printable {

   public void startTestCase() {

        PrinterJob pj = PrinterJob.getPrinterJob();
        PrintRequestAttributeSet pras  = new HashPrintRequestAttributeSet();
        pras.add(DialogTypeSelection.NATIVE);
        pras.add(SheetCollate.COLLATED);
        pras.add(new Copies(2));
        pj.setPrintable(this);

        if (pj.printDialog(pras)) {
            try {
                pj.print(pras);
            } catch (Exception e) {
            }
        }
   }

public int print(Graphics g, PageFormat pf, int pageNo) throws PrinterException
{
    if (pageNo > 2) {
       return Printable.NO_SUCH_PAGE;
    } else {
        g.setColor(Color.black);
        Font fnt = new Font("Serif", Font.PLAIN, 32);   /* Cover page */
        g.setFont(fnt);
        g.drawString("Page no: "+Integer.toString(pageNo), 100, 200);
        return Printable.PAGE_EXISTS;
    }
}

   public static void main (String []Args) {
      SunTest st = new SunTest ();
      st.startTestCase ();
   }
}
                                    

Comments
URL:   http://hg.openjdk.java.net/jdk7u/jdk7u-dev/jdk/rev/dc0aeab104f0
User:  jgodinez
Date:  2013-06-03 16:50:53 +0000

                                     
2013-06-03
URL:   http://hg.openjdk.java.net/jdk7u/jdk7u/jdk/rev/dc0aeab104f0
User:  lana
Date:  2013-06-17 17:00:03 +0000

                                     
2013-06-17



Hardware and Software, Engineered to Work Together