printShowingPrintPanel - problem with settings in 10.2
printShowingPrintPanel - problem with settings in 10.2
- Subject: printShowingPrintPanel - problem with settings in 10.2
- From: Gideon King <email@hidden>
- Date: Sun, 27 Oct 2002 20:58:20 +0800
We have two views that need to be printed using the same print
operation, using slightly different settings. In 10.1, what we were
able to do is use printShowingPrintPanel: Within that method, we could
show the print panel with the shared print info to collect the settings:
[pp beginSheetWithPrintInfo: [NSPrintInfo sharedPrintInfo]
modalForWindow:theWindow
delegate:self
didEndSelector:@selector(printPanelDidEnd:returnCode:contextInfo:)
contextInfo:nil];
In the printPanelDidEnd:returnCode:contextInfo: method, we were then
able to set margins, orientation, pagination options etc in the shared
print info object, then we could use:
po = [NSPrintOperation printOperationWithView:whatever
printInfo:[NSPrintInfo sharedPrintInfo]];
[po setShowPanels:NO];
[po runOperation];
for each of our views. This would print our views to the selected
printer, and if the preview button was selected, the preview would
happen. We need to do it in this way because we have two views to print
and our own print panel accessory view that alters things like the
pagination.
In 10.2, the printing happens on the default printer, no matter which
printer the user has selected, and if they have pressed the preview
button, the preview doesn't happen - instead it always prints out on
the printer.
It therefore appears that in 10.2, the selection options are not
remembered from the print sheet (not written in to the shared print
info) when we create the print operation. We have tried creating our
own print info object (initialized with the shared print info's
values), and using that throughout the rest of the print operation, but
that didn't help.
Does anyone have a solution for this - preferably something which will
work for both 10.1 and 10.2?
TIA
Gideon.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.