Reputation: 1
I'm planning to develop an iPhone app in which will do the following:
I really want to know how to achieve the above, what classes to use and what tips should I consider?
Thanks
Upvotes: 0
Views: 4045
Reputation: 481
When downloading large files on mobile devices it's a good idea to save the data as it comes in. I suggest you use a good network library that performs all this work for you: ASIHTTPRequest and AFNetworking are both very good and actively maintained.
Since your pdf files are password protected you'll need to write a custom pdf viewer. For non-password protected pdf files you could have used the QuickLook framework to display pdf files.
You can unlock pdf files by using the CGPDFDocumentUnlockWithPassword function which takes 2 arguments: a CGPDFDocumentRef reference to the pdf document and a const char* password. Opening the pdf file first with the CGPDFDocumentCreateWithURL function will give you a CGPDFDocumentRef reference.
Upvotes: 2
Reputation: 7641
I've written a pretty good Kiosk-Example that does the download, displaying the progress bar, saving the pdf in documents directory, displaying, opening - everything you want.
Password support is included, and looks like that:
const char *key = [passwordString UTF8String];
BOOL success = CGPDFDocumentUnlockWithPassword(pdf, key);
Upvotes: 1