--- old/src/java.desktop/macosx/native/libawt_lwawt/awt/CPrinterJob.m 2018-09-26 16:58:03.758790000 +0530 +++ new/src/java.desktop/macosx/native/libawt_lwawt/awt/CPrinterJob.m 2018-09-26 16:58:03.258540000 +0530 @@ -315,6 +315,14 @@ static JNF_MEMBER_CACHE(jm_setCopiesAttribute, sjc_CPrinterJob, "setCopiesAttribute", "(I)V"); static JNF_MEMBER_CACHE(jm_setCollated, sjc_CPrinterJob, "setCollated", "(Z)V"); static JNF_MEMBER_CACHE(jm_setPageRangeAttribute, sjc_CPrinterJob, "setPageRangeAttribute", "(IIZ)V"); + static JNF_MEMBER_CACHE(jm_setPrintToFile, sjc_CPrinterJob, "setPrintToFile", "(Z)V"); + + NSPrintJobDispositionValue jobDisposition = [src jobDisposition]; + if (jobDisposition == NSPrintSaveJob) { + JNFCallVoidMethod(env, dstPrinterJob, jm_setPrintToFile, true); + } else { + JNFCallVoidMethod(env, dstPrinterJob, jm_setPrintToFile, false); + } // get the selected printer's name, and set the appropriate PrintService on the Java side NSString *name = [[src printer] name];