--- old/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java 2016-03-18 14:16:11.000000000 +0530 +++ new/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java 2016-03-18 14:16:11.000000000 +0530 @@ -36,6 +36,7 @@ import javax.print.*; import javax.print.attribute.PrintRequestAttributeSet; import javax.print.attribute.HashPrintRequestAttributeSet; +import javax.print.attribute.standard.Copies; import javax.print.attribute.standard.Media; import javax.print.attribute.standard.MediaPrintableArea; import javax.print.attribute.standard.MediaSize; @@ -198,6 +199,19 @@ } } + private void setPageRangeAttribute(int from, int to) { + if (attributes != null) { + attributes.add(new PageRanges(from, to)); + setPageRange(from, to); + } + } + + private void setCopiesAttribute(int copies) { + attributes.add(new Copies(copies)); + super.setCopies(copies); + } + + volatile boolean onEventThread; @Override @@ -606,7 +620,7 @@ page.getImageableHeight()); return pageFormatArea; } - + private boolean cancelCheck() { // This is called from the native side. @@ -653,7 +667,7 @@ Graphics2D delegate = new SunGraphics2D(sd, Color.black, Color.white, defaultFont); Graphics2D pathGraphics = new CPrinterGraphics(delegate, printerJob); // Just stores delegate into an ivar - Rectangle2D pageFormatArea = getPageFormatArea(page); + Rectangle2D pageFormatArea = getPageFormatArea(page); initPrinterGraphics(pathGraphics, pageFormatArea); painter.print(pathGraphics, page, pageIndex); delegate.dispose(); @@ -688,7 +702,7 @@ if (printable != null) { BufferedImage bimg = new BufferedImage((int)Math.round(pageFormat.getWidth()), (int)Math.round(pageFormat.getHeight()), BufferedImage.TYPE_INT_ARGB_PRE); PeekGraphics peekGraphics = createPeekGraphics(bimg.createGraphics(), printerJob); - Rectangle2D pageFormatArea = getPageFormatArea(pageFormat); + Rectangle2D pageFormatArea = getPageFormatArea(pageFormat); initPrinterGraphics(peekGraphics, pageFormatArea); // Do the assignment here!