We are trying to open a password protected PDF/DOC file in UIWebview. Due to security concern, we can only retrieve the files from server and store into memory (i.e. NSData), but cannot store as a file.
We tried to use loaddata function in UIWebiew and it can only success to load doc/xls/ppt/pdf without password protected.
For doc/xls files with password, it shows "Unable to Read Document. The operation couldn't be completed (QuickLookErrorDomain error 44820/912". May I ask how can we open the file in UIWebview?
For pdf file with password, it shows "The document "blank" is password protected". May I ask how can we show the correct document name instead of "Blank"?
I have also searched the cgpdf and know how to unlock the pdf file as CGPDFDocumentRef, but cannot find the way to change it back to NSData and input into UIWebview directly.
Thanks.
Write file in local and read the data and show it in web view
Update without writing the file data in local, Process the data in memory and show the pdf file in webview