Re: Running printJob sheet without printing?
Re: Running printJob sheet without printing?
- Subject: Re: Running printJob sheet without printing?
- From: Aaron Tuller <email@hidden>
- Date: Wed, 2 Mar 2005 10:29:00 -0800
Please file an enhancement request, I bugged the printing guys about
this at the last WWDC, it would be so helpful to me. What I do is
just call up the print panel:
NSPrintPanel *pp = [NSPrintPanel printPanel];
[pp beginSheetWithPrintInfo:printInfo modalForWindow:[self window]
delegate:self
didEndSelector:@selector(printPanelDidEnd:returnCode:contextInfo:)
contextInfo:printInfo];
and then stash the print info when it returns then when I actually
print, i call:
NSPrintOperation *po = [NSPrintOperation
printOperationWithView:superContent printInfo:printInfo];
[po setShowPanels:NO];
[po runOperation];
where po is a NSPrintOperation on my view and printInfo is what I
grabbed after the sheet ran.
the only problem is the panel still says "Print" so I have an extra
alert that pops-up letting users now that Print doesn't really mean
print just "save". It's ugly, but really the only solution I could
come up with.
-aaron
At 10:38 AM -0600 3/2/05, glenn andreas wrote:
You can run the page setup sheet with
runModalPageLayoutWithPrintInfo: but how does one run the job dialog
without actually initiating a print job?
runModalPrintOperation:delegate:didRunSelector:contextInfo: calls
the delegate back after the print job is completed - I need to just
display the dialog and not have the print job happening.
The background problem is that I've got something that potentially
can take a great deal of time to print (think rendering a complex
image) and I don't want to tied down the document while doing that.
I've already got support for rendering to a file in it's own thread
(with a little "job monitor" UI so you can monitor the progress,
cancel, etc...) so I'd like to handle printing in the same way.
I've got everything I need to be able to print the rendered image,
but at some point I want to show the job dialog to so the user can
do things like specify print mode, paper type, etc... (all the
driver specific goodies) which I can capture into the NSPrintInfo
(which I'd then use when actually submitting the job).
Short of writing some super ugly "watch the sheets go up and down,
and then cancel the print job really quick" sort of hack, any ideas?
The best I've come up with is a custom subclass of NSPrintOperation
that doesn't actually do anything (but let's me grab the
NSPrintInfo)...
Glenn Andreas email@hidden
<http://www.gandreas.com/> oh my!
Mad, Bad, and Dangerous to Know
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden