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

openDoc and bHidden

chaida
Registered: Sep 9 2008
Posts: 34

Hi,

I want to open a document and doesn't want the user see the document, I would like this file to be hidden.

var doc = app.openDoc({cPath: atbPath+ "/images.pdf", bHidden: true})

I try the openDoc with the parameter bHidden to true, but it's still open the document that is visible to the user.

Is there something wrong in my code?

maxwyss
Registered: Jul 25 2006
Posts: 255
It is a bit speculative, and I could be completely wrong, but it might be worthwile checking whether the "open cross-document links in same window" preference is checked. Uncheck it and see if things change. Unfortunately, that option is checked by factory default, and the discussions about how reasonable that is have been around for years...

Hope this can help.

Max.
chaida
Registered: Sep 9 2008
Posts: 34
Unfortunally it does nothing when you check or uncheck "Open cross-document links in same window", my document is still not hidden even though I specify in the parameter ...



maxwyss wrote:
It is a bit speculative, and I could be completely wrong, but it might be worthwile checking whether the "open cross-document links in same window" preference is checked. Uncheck it and see if things change. Unfortunately, that option is checked by factory default, and the discussions about how reasonable that is have been around for years...Hope this can help.

Max.
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
What version of Acrobat are you testing this with?

George
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
Just did a quick test and it will open a document as hidden if the openDoc statement is executed from the JavaScript console, but not from a button event. So it's likely, though perhaps not documented, that opening a document as hidden is only supported in certain circumstances.

George
chaida
Registered: Sep 9 2008
Posts: 34
I'm using Acrobat Pro 9.
I put my code in the folder application, so it's run each time that I Acrobat starts.

So I guess it's because I put the code there that it doesn't hide my pdf.
maxwyss
Registered: Jul 25 2006
Posts: 255
Another thing to test is whether the document to be opened has the "disclosed" property set to true. In order to do that, add a document-level script which contains just this line:

this.disclosed = true ;

It is possible that the bHidden argument is actually

var xx = app.openDoc("mydoc.pdf") ;
xx.hidden = true ;


More head scratching...

Hope this can help.

Max.