Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Add link to external file

Anonymous
Not applicable
Hi,



i want to add a link to an external file in my document.

like "-a href=file://local path ... in html.



regards

Johannes
9 Replies
pguerett
Level 10
Level 10
You can use the command:



app.launchURL("http://www.adobe.com", true)



where the second parameter is a boolean that says whether to launch the URL in a new window or not. The default is false.



Hope that helps
Anonymous
Not applicable
Thx Paul,



but I don't want to open a http URL, I want to open a doc file that is located on a public folder or on my local disk.



app.launchURL("file://c:/temp/t.txt", true);



does not work.



regards

Johannes
pguerett
Level 10
Level 10
I tried it here and found that it gave a security error. I do not think that the launchURL command allows you to get to a file on file system.



You could try certifying the document.
Anonymous
Not applicable
I had the same security problem.



But if I thing of importing an Word-doc that includes hyperlinks to files, how would this work?



Isn't it quiet common to include hyperlinks to files and not only to the web into forms?
pguerett
Level 10
Level 10
If you import a word file into designer then those links would be ignored. If you create a PDF from the word file (in Acrobat) then the links would be maintained.
Anonymous
Not applicable
Ok

but the feature which enables me to open a file via a hyperlink is not provided in the LC Designer?
pguerett
Level 10
Level 10
That is why we cannot support them when we import the word file.
_Aandi_Inston_
Level 7
Level 7
You would need to do your forms in Acrobat to have such features.



Aandi Inston
Not applicable
Adobe does have a secruity feature built in that keeps you from opening files or folders on the file system, but there is a way around this. First on your form you would put something like this on the click event of a button for your link:



var myPath = "o|/Network Folder/FileName";

openNetworkFolder(myPath);



Next you need to set up a JavaScript file that you will save as a trusted function for Reader. This js file should have the following code:



openNetworkFolder = app.trustedFunction(function (sURL) {

app.beginPriv();

try {

var nDoc = app.launchURL("file:///" + sURL, true);

} catch (err) {

app.alert('Error: ' + err);

}

app.endPriv();

});



This js file will need to be saved on each users local machine in their javascripts folder for reader. Also if you are pointing to a shared network folder, each user will need to have the same drive mapped for this to work properly for each user. This workaround allows you to bypass the built in Adobe security without having to sign the document.