Optimizing PDFKit
Optimizing PDFKit
- Subject: Optimizing PDFKit
- From: Ricky Sharp <email@hidden>
- Date: Tue, 4 Oct 2005 16:11:45 -0500
All images for my app are now PDF and I'd like to encrypt them to
protect my artwork.
Anyhow, I wanted to make sure my image loading times would not
suffer. I kept all my PDFs unencrypted and changed this line:
NSImage* theImage = [[NSImage alloc]
initWithContentsOfFile:theImagePath];
to...
NSURL* thePDFURL = [[[NSURL alloc]
initFileURLWithPath:theImagePath] autorelease];
PDFDocument* thePDFDocument = [[[PDFDocument alloc]
initWithURL:thePDFURL] autorelease];
if ([thePDFDocument isEncrypted])
{
// not yet implemented
}
NSImage* theImage = [[NSImage alloc] initWithData:
[thePDFDocument dataRepresentation]];
For the same run of a test script, the PDFKit code is a full order of
magnitude slower. I'm running 10.4.2 on a dual 2GHz G5 and am
concerned about users with slower machines.
Does anyone know of a different (faster) path to decrypt PDFs and
ultimately create NSImage instances out of them?
Thanks,
___________________________________________________________
Ricky A. Sharp mailto:email@hidden
Instant Interactive(tm) http://www.instantinteractive.com
_______________________________________________
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