Re: How to create paginated PDF Data from NSView without using NSPrintOperation.
Re: How to create paginated PDF Data from NSView without using NSPrintOperation.
- Subject: Re: How to create paginated PDF Data from NSView without using NSPrintOperation.
- From: Andy Lee <email@hidden>
- Date: Tue, 21 Mar 2006 23:58:54 -0500
On Mar 21, 2006, at 11:22 PM, Janakiram wrote:
I have a view to display my cocoa application data. Now i want to
display the preview of that view in print panel accessory view. So
i need to create a paginated pdf document.
How about using NSView's -dataWithPDFInsideRect: method? The doc says:
Returns PDF data that draws the region of the receiver within a
specified rectangle.
[...]
This data can be placed on an NSPasteboard object, written to a
file, or used to create an NSImage object.
You could combine this with -rectForPage: to create a series of
NSImages. There's probably some way to put these together into a
single paginated PDF, but if your main purpose is to display a
preview, this might suffice.
--Andy
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden