Trying to figure out how to write a 'documentlevel' script that does take a parameter (or preferably more). Using VB.NET-2005. (100+)Links are practically doing the same thing, want them to call a (not necessarily global) function, which can do several things, such as gotoNamedDest, reset bodercolors on annots on the page of the dest, and find a named annot, change it's bordercolor, so one can see what the link was about. To put the whole script in the link's setAction, is just too much......., should be much more simple.
jso.addScript("MyScript", "function Goto(d) {this.gotoNamedDest(d)}")
Link.setAction("MyScript('namedest')")
This will compile, but in the PDF it complains about 'missing formal parameter'.
What do I do wrong?
Are you sure that the second line is correct? is "Link" a JavaScript link object? The JSO can have problems with JavaScript Objects.
Where is the named destination created? Does it really exist in the document?
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script