Re: Help with displaying encrypted PDF image
Re: Help with displaying encrypted PDF image
- Subject: Re: Help with displaying encrypted PDF image
- From: Antonio Nunes <email@hidden>
- Date: Sun, 17 Feb 2008 17:13:03 +0100
On Feb 17, 2008, at 2:52 PM, Mario Gajardo Tassara wrote:
Hi, im trying to displaying encrypted pdf formated images in cocoa.
this is my code to load these images, but nothing is displayed,
however non encrypted pdf displayed with zero problems. All my
encrypted images seems to be decrypted because the printf statement
"unlocked" is reached always. Any help will be appreciated, thanks.
Off the top of my head: this is probably related to the inability to
write encrypted but unlocked documents back out to file. Try drawing
your PDFDocument into an NSImage instead of initializing an NSImage
from the dataRepresentation of the PDFDocument. Something to the
effect of:
NSImage *pix2 = [[NSImage alloc] initWithSize:[pdfImage
boundsForBox:kPDFDisplayBoxMediaBox].size];
[pix2 lockFocus];
[[pdfImage pageAtIndex:0] drawWithBox:
boundsForBox:kPDFDisplayBoxMediaBox];
[pix2 unlockFocus];
(Typed directly into Mail, so untested.)
-António
--------------------------------------------
I try to take one day at a time, but sometimes, several days attack me
all at once!
--------------------------------------------
_______________________________________________
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