Re: Printing an NSDocument
Re: Printing an NSDocument
- Subject: Re: Printing an NSDocument
- From: Scott Anguish <email@hidden>
- Date: Fri, 19 Mar 2010 02:26:54 -0400
On Mar 18, 2010, at 7:17 PM, Jenny M wrote:
> Sorry, no answer, I'm just having a similar issue. I need to print
> columns of text, and all the examples I see indicate a manual creation
> and placement of EACH line of text in an NSRect inside the view. ...
> Is there really no better way to place objects in the view?
>
>
if the columns of text match line for line, why not use two NSTextViews side by side? You’ll still likely need to handle pagination, but you don’t have to draw each one.
A WebKit view may also be another option.
> On Mar 18, 12:47 pm, Brian Postow <email@hidden> wrote:
>> I'm trying to print a document. The document is an array of NSImageReps, or a single NSPDFImageRep, which has multiple pages. I'm having trouble figuring out how to use the NSPrintOperation class to print this.
>>
>> The NSPrintOperation seems to need an NSView to print. Do I need to manually add each image into the view at a calculated position and then let it do the pagination? that seems like it isn't in the spirit of Cocoa... is there some technique that I'm missing?
Nope, you’re not missing anything. If you want to ensure that pagination doesn’t occur during the middle of one of your images, you have to handle that yourself.
Our old Cocoa Programming book covered this. The PaginationDemos are still available for download at www.cocoaprogramming.net. Mind you, Xcode can’t read the project, so you’ll need to make a new project and drag the classes and nib in. (or just get the ideas from it).
Chapter 25 examples
_______________________________________________
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