Re: NSPrintInfo and NSPageLayout
Re: NSPrintInfo and NSPageLayout
- Subject: Re: NSPrintInfo and NSPageLayout
- From: Torsten Curdt <email@hidden>
- Date: Fri, 07 Oct 2011 12:05:36 +0200
>> 1) Currently I set the width of the view to the page size width minus
>> the left and right margin. Frankly speaking I have no clue if that is
>> the right thing to do. Or is imageablePageBounds the one to use?
>
> I'm not sure. I know that you can get the PMPageFormat object from the NSPrintInfo and then call PMGetAdjustedPageRect() on it, if that helps. Hopefully others can provide a better answer.
Oh, that sounds useful. Can someone else confirm/correct otherwise?
>> 2) When I configure the page layout with [[NSPageLayout pageLayout]
>> runModal] the layout settings don't make it over to my print dialog.
>> For example I tried to change the orientation but when I get the print
>> dialog it's still in portrait. It's not that surprising as I don't see
>> the connection between the two yet - but how do I make the connection?
>
> The -runModal method uses the shared print info object, which can be obtained with +[NSPrintInfo sharedPrintInfo]. You can change the shared print info with +[NSPrintInfo setSharedPrintInfo:], if you have reason to. Alternatively, you can use -[NSPageLayout runModalWithPrintInfo:] to use a different print info for the page layout dialog.
>
> In any case, you need to use the same print info object for the NSPrintOperation so that it can use that for the NSPrintPanel. That's how changes made in the page setup dialog get communicated to the print dialog.
So I am also in charge of serializing the settings across restarts?
> So, you can have both dialogs use the shared print info object (using the methods which don't take an explicit print info object) or you can specify your own print info object to both (passing the same object to the methods which do take an explicit print info object).
Thanks a lot, Ken.
cheers,
Torsten
_______________________________________________
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