• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Help with displaying encrypted PDF image
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Help with displaying encrypted PDF image (From: Mario Gajardo Tassara <email@hidden>)

  • Prev by Date: Re: CFDictionary callback on PPC vs Intel
  • Next by Date: Re: [Foo new] vs [[Foo alloc] init]:
  • Previous by thread: Help with displaying encrypted PDF image
  • Next by thread: Re: Help with displaying encrypted PDF image
  • Index(es):
    • Date
    • Thread