On Sep 23, 2008, at 4:11 AM, Danny Greg wrote:
I am trying to save a PDF annotated using subclasses of
PDFAnnotation to an image (such as a png, jpg etc) or a PDF such
that the annotations are displayed. So the resulting image should be
annotated.
Not too much code.....
Get the size of said page (-[PDFPage boundsForBox:]) and create an
NSImage of this size (-[[NSImage alloc] initWithSize:]). Lock the
image (-[NSImage lockFocus]) and then call PDFPage;s draw method (-
[PDFPage drawWithBox:]). Unlock focus on the NSImage and you;re done.
This is off the top of my head so I haven't tested the code.
Oh, you may need to throw in a -[PDFPage transformContextForBox:] so
it works with PDF's with rotated pages, etc.
John Calhoun—_______________________________________________
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [EMAIL PROTECTED]