Simple printing hangs
Simple printing hangs
- Subject: Simple printing hangs
- From: James Walker <email@hidden>
- Date: Tue, 07 Apr 2009 17:33:11 -0700
I want to print some text that will almost surely fit on one page. I
thought I could just set up a window without making it visible, and
print the content view of the window, with code like this:
NSView* contentView = (NSView*) [oPrintWindow contentView];
NSPrintInfo *pi = [NSPrintInfo sharedPrintInfo];
[pi setVerticallyCentered: NO];
[pi setHorizontallyCentered: NO];
[pi setLeftMargin: 72.0f];
[pi setTopMargin: 72.0f];
[pi setHorizontalPagination: NSFitPagination];
[pi setVerticalPagination: NSFitPagination];
NSPrintOperation *printOp = [NSPrintOperation
printOperationWithView: contentView
printInfo: pi];
[printOp setShowPanels:YES];
[printOp runOperation];
What happens is that I see the print panel, I click Print or Preview,
and then I see a progress window with a progress bar that has gone all
the way to the right and a Cancel button. And the progress window just
sits there forever. (If I click Cancel, the progress bar changes to a
barber pole animating forever.) What am I missing?
--
James W. Walker, Innoventive Software LLC
<http://www.frameforge3d.com/>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden