These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

pass password to open encrypted PDF doc in adobe command string?

ddi
Registered: Jul 19 2007
Posts: 4

Is there a way to pass a password to open an encrypted PDF document in an adobe command string?

(we're looking for C# code)

This is what we'd like to do... when a user has signed into our application (with user ID and password) and they click to view a PDF, we would like for the PDF to open without prompting for password...this command string would pass the adobe reader password in and open the PDF automatically...

THANKS!

My Product Information:
Reader 8.1.2
lkassuba
ExpertTeam
Registered: Jun 28 2007
Posts: 3636
You could do this with a plug-in. For more detail on this visit the following Developer's knowledgebase article at:
http://support.adobe.com/devsup/devsup.nsf/docs/52224.htm

Lori Kassuba is an AUC Expert and Community Manager for AcrobatUsers.com.

patelpiyushb
Registered: Dec 2 2008
Posts: 10
Dear Ikassuba,
Thank you very much for a link to a method.
As i design a intranet site using ASP-VB Script with a locally stored pdf files. When user click on a created link to point a pdf file, pdf file is open in browser.

Now i want that user will only able to open a file within my intranet site, so i apply a password to open a pdf file and require that password is hard coded in website's ASP code and upon click on a link a script in ASP will input the password in password field of encrypted pdf document and document will open without need of user password input. So ultimately whole process is transparent to user if user is try to open pdf file within my website, but if user save a copy of pdf file and try to open it outside of my website, he is unable to open it because he does not know the user password of pdf file.

As im begginer in programming and specially in JavaScript, please tell me the exact code example, so im able to put this method in my website.

Regards,
PIYUSH PATEL.
UVSAR
Expert
Registered: Oct 29 2008
Posts: 1357
Now that you can't do.

First, without a plugin a webserver-based script cannot interact directly with the Reader GUI (thankfully, or we'd be allowing malware to take control) - all you can do via the JS interface is perform basic document-level tasks like navigation. You can't fill in things like the password dialog boxes.

Second, there's no concept of 'within my website' - a PDF is downloaded for viewing, so Reader *always* sees it as a local copy of the file, be it in the browser cache or not. Whatever password-collection scheme you devise it'll work just the same on duplicated copies unless you adopt a DRM licensing system.
patelpiyushb
Registered: Dec 2 2008
Posts: 10
Thank you very much for quick and prompt answer,
From where i can get this type of plugin or is it possible to creat this type of plugin by our self?
do we need to distribute the plugin so after installing the plugin, user is able to read the pdf?
UVSAR
Expert
Registered: Oct 29 2008
Posts: 1357
Plugins have to be written (using the Acrobat SDK and a not-inconsiderable amount of skill with a language such as C++ - Javascript does not 'do' plugins!) either by you or a programmer, and you would then have to distribute them to every reader, so would require them to be digitally signed. I doubt there's anything off the shelf that will do what you want, and in any case it would need to be customized for your specific servers. All in all, not a trivial project if you're new to programming.
patelpiyushb
Registered: Dec 2 2008
Posts: 10
In above reply topic it refers that "Reader security handler plug-in to open secured PDFs by using PDDocOpenEx to specify a custom AuthProc".

Can you show me sample AuthProc code for a hard coded string? may be with this i'm able to find some solution.

Regard,
juruiz
Registered: Feb 19 2009
Posts: 1
I used to be able to read PDF files and now I can't, why?????????