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

Document Level Function failing only when called on form open

AndrewAlb
Registered: Aug 16 2007
Posts: 97

I have a document level function that works fine. I want to run that function when the document opens - so I made another document level script and told it to run that function when the form opens (I just wrote the name of the function in a document level script). However when I do that Acrobat tells me that the function doesn't exist and it never loads the function.
 
I think this has to do with the order in which adobe is building the form - that is, it calls the function in the document level script before it gets a chance to actually load it - then it fails - then it never loads it....?
 
Is there any work around for this? Am I doing something incorrectly?
 
I thought about attaching it to the page On-Open event but that won't work for me due to some specifics of my situation.
 
Any idea what is going on here in acrobat and how I can work around it? It is adobe acrobat pro 8.1 (Not livecycle).
 
Thank You.

Andrew D. Albrecht, MS
Solutions Developer
ING USFS

My Product Information:
Acrobat Pro 8.0999999999999996447286321199499070644378662109375, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Put the code that calls the function immediatly after the function definition in the same document script.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script