How to execute javaScript with Quartz (CGPDF) iPhone SDK
I would like to know that is it possible to run the JavaScript with Quartz.
I have to create an application to open the password protected PDF. I also have user name and password for that PDF and when user want to open the PDF I send the username and password to server. All the validation will be happend on server then server returning me the JavaScript code in response, I have to run the same JavaScript code in my App to unlock the PDF. Is there any way to run the javaScript in my App So that I will be able to open the Password Protected PDF.
I have tried to open the same PDF in al开发者_运维知识库l Standered iPad PDF App like(GoodReader, PDF Reader and so on) but they are also failed to unlock the PDF. When I open the Same PDF in Adobe Reader in my MAC machine it open successfully.
Thanks
There's currently (as of iOS4/5) no way to use Javascript inside a PDF. You can use javascript in a web view, and do your server checks there, then unlocking the pdf, but that's of course not as secure as doing it all in the pdf. Some crazy people even included a custom build of the JavaScriptCore, as the Apple Framework is not directly accessible in iOS.
精彩评论