Have you looked at the documenation for both of those methods? Does it have to work with Reader?
Thanks for your quick response.
Actually, i refered to several JS Developper Guides which not describe a method so as to open a specific file (html extension in my case) as i would like to link on.
The link must work with Reader but i already checked it with the following code and it works well :
Link = addLink(p, [r, r, r, r]);
Link.borderColor = color.red
Link.borderWidth = 1
Hope you could help me.
Are you trying to launch a local HTML file, or a file located on the internet?
Indeed, it's a local HTML file.
Then you can use launchURL, but only from a privileged context.
What do you mean by privileged context ?
I tried to open my file with the following line : myLink.setAction(app.launchURL('D:\HTML\test.html'));
but the JS Debugger reply is always :
NotAllowedError: Security settings prevent access to this property or method.
1 person found this helpful
First of all, your path is incorrect. It needs to be something like this: "file:///D:/HTML/test.html"
To get the right path, the best way is to simply open the file in your browser and then copy the URL from the location bar.
A privileged context means it needs to run from the console, in a batch process, or from a trusted function in a folder-level script.
The latter means that each user of this file will have to have that script installed on their local machine.
See here for more info on this subject: http://acrobatusers.com/tutorials/using_trusted_functions
Thanks a lot for your quick responses try67 !