Help with displaying encrypted PDF image
Help with displaying encrypted PDF image
- Subject: Help with displaying encrypted PDF image
- From: Mario Gajardo Tassara <email@hidden>
- Date: Sun, 17 Feb 2008 10:52:32 -0300
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.
NSImage *pix2;
NSData *pdfData=[[NSData alloc]initWithContentsOfFile:image_path_];
PDFDocument *pdfImage=[[PDFDocument alloc]initWithData:pdfData];
if([pdfImage isLocked]) {
if([pdfImage unlockWithPassword:@"xxxx"]) {
printf("unlocked");
}
else {
printf("error");
}
}
pix2=[[NSImage alloc]initWithData:[pdfImage dataRepresentation]];
[pix2 drawInRect:[spritesGCObjectsArray_ returnSpriteRect_]
fromRect:NSZeroRect
operation:NSCompositeCopy
fraction:1];
Mario Gajardo Tassara
_______________________________________________
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