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

app.openDoc won't work

jsmarlin
Registered: Jul 18 2008
Posts: 7

How can I make a button on one already open pdf file open another pre-specified pdf file? Am I on the right track by using the app.openDoc method?

gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4307
If you are using Acrobat/Reader 5.05 or above, the PDF you are attempting to open must have that PDF's "disclosed" property set to true or your open request will return a null object insted of the requested object.
The setting of the "disclosed" property is done with a document level script:

this.disclosed = true;

You can give the script any meaningful name.

See [url=http://www.acrobatusers.com/tutorials/2007/js_document_scripts/]Entering Document Scripts[/url] by Thom Parker for instructions on how to access or create a document level script.

George Kaiser

jsmarlin
Registered: Jul 18 2008
Posts: 7
Thank you very much. It works now.
Is there a way to get it to open a file from a list that is displayed for the user. For instance, if the user selects a file from a drop-down list and then that file is the one that is opened.