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

Javascript and PDF Forms

productdesign12
Registered: Jan 30 2009
Posts: 2

I need to insert a path name to a file in a field, preferably using a point and click method such as provided by the BrowseForFileToSubmit function. However, I don't want the file, only the pathname to the file so that I can stuff the link into a database. is there a javascript to make this possible?

Thanks

My Product Information:
Acrobat Pro 9.0, Macintosh
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Yes and no, There is an undocumented folder browse function in Acrobat 8 and later.

Collab.browseForNetworkFolder()

There was a function named "Collab.browseForFolder" in Acrobat 7, but it's no longer around.
The "Collab.browseForNetworkFolder()" fucntion will only return network folder, it'll throw an exception if the user selects a local folder. And of course this fucntion will only work when called from a privileged context.

So the short answer is No, there's nothing similar to the "browseForFileToSubmit". Your best bet is to use this function, make the user select a file in that folder, then slice off the field name, and turn off the "field.fileSelect" property.

Awkward, but that's not uncommon.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

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