• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Simple printing hangs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Simple printing hangs
      • From: "I. Savant" <email@hidden>
  • Prev by Date: Re: Storing bundle loaded main class instances in NSArray
  • Next by Date: re: SQLite3 and Unicode Strings - Problem
  • Previous by thread: Re: Storing bundle loaded main class instances in NSArray
  • Next by thread: Re: Simple printing hangs
  • Index(es):
    • Date
    • Thread