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

problem with OpenDoc

arnold.storm
Registered: May 15 2011
Posts: 2

Hi
 
I'm having a problem getting OpenDoc to work. Working with Acrobat X, but need this to work in Reader 9 also.
 
I have created the below function in a app script stored in c:\Prog Files\Adobe\Acrobat 10\acrobat\javascripts. the relevant portion of the function is set to priviliged, and the "ZZScript.pdf" file exists in the same folder as the PDF that is calling the function. however it still always returns an exception o n the DocOpen call.
 
I do have the "this.disclosed = true" statment in a doc script in ZScripts.pdf.
 
I have also tried with out the "oDoc:this" parameter, and changed the cPath to "/w/Drawings/ZScripts.pdf", but got the same result.
 
Any help appreciated
  
getData = app.trustedFunction( function ()
{
try{
app.beginPriv();
var oDoc1 = app.openDoc({cPath:"ZScripts.pdf", oDoc:this, bHidden:true });
 
var cWord1 = oDoc1.getField("Word1").value;
oDoc1.closeDoc();
app.endPriv();
}
catch (e)
{
app.alert("Unable to open Control file. Please contact the Hillside Document Administrator");
cWord1 = "Undefined";
}
return (cWord1);
})
  

Arnold Storm

My Product Information:
Acrobat Pro 10.0, Windows
try67
Expert
Registered: Oct 30 2008
Posts: 2398
You can't use "this" to refer to the currently opened document from within this function.
You must pass the Doc object as a parameter to the function.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

arnold.storm
Registered: May 15 2011
Posts: 2
thanks for that. Unfortunatley is still hasnt helped, still getting an exception on the openDoc line.

I'm obviosly missing something really basic here as I thought I had everything covered.

Any help appreciated.

Arnold Storm