Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

7179006: [macosx] Print-to-file doesn't work: printing to the default printer instead. #339

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -254,7 +254,6 @@ private void setPrintToFile(boolean printToFile) {
}

private void setDestinationFile(String dest) {
System.out.println("dest="+dest+" attrs="+attributes);
if (attributes != null && dest != null) {
try {
URI destURI = new URI(dest);
@@ -432,13 +432,10 @@ static JNF_MEMBER_CACHE(jm_getDestinationFile, sjc_CPrinterJob,

jstring dest = JNFCallObjectMethod(env, srcPrinterJob, jm_getDestinationFile);
if (dest != NULL) {
NSString *nsDestStr = JNFJavaToNSString(env, dest);
[dst setJobDisposition:NSPrintSaveJob];
// [printingDictionary setObject:nsDestStr forKey:NSPrintSavePath];
//NSURL *nsURL = [NSURL URLWithString:nsDestStr];
NSString *nsDestStr = JNFJavaToNSString(env, dest);
NSURL *nsURL = [NSURL fileURLWithPath:nsDestStr isDirectory:NO];
[printingDictionary setObject:nsURL forKey:NSPrintJobSavingURL];
// JNFCallVoidMethod(env, dstPrinterJob, jm_setPrintToFile, true);
} else {
[dst setJobDisposition:NSPrintSpoolJob];
}
@@ -23,6 +23,7 @@

/*
@test
@key printer
@bug 4865976 7158366 7179006
@summary Pass if program exits.
@run main/manual PrintDlgApp
@@ -23,6 +23,7 @@

/**
* @test
* @key printer
* @bug 7179006
* @summary Confirm printing to file works.
*/