< prev index next >

src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java

Print this page

        

*** 244,253 **** --- 244,258 ---- } else { r.run(); } } + boolean isPrintToFile = false; + private void setPrintToFile(boolean printToFile) { + isPrintToFile = printToFile; + } + @Override public void print(PrintRequestAttributeSet attributes) throws PrinterException { // NOTE: Some of this code is copied from RasterPrinterJob.
*** 255,265 **** // this will make it print directly to the printer // this will not work if the user clicks on the "Preview" button // However if the printer is a StreamPrintService, its the right path. PrintService psvc = getPrintService(); ! if (psvc == null) { throw new PrinterException("No print service found."); } if (psvc instanceof StreamPrintService) { spoolToService(psvc, attributes); --- 260,270 ---- // this will make it print directly to the printer // this will not work if the user clicks on the "Preview" button // However if the printer is a StreamPrintService, its the right path. PrintService psvc = getPrintService(); ! if (psvc == null && !isPrintToFile) { throw new PrinterException("No print service found."); } if (psvc instanceof StreamPrintService) { spoolToService(psvc, attributes);
< prev index next >