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

Trouble with Javascript in Acrobat Reader

TheWad02
Registered: Jul 31 2008
Posts: 6

I put together a small script in Acrobat Pro 9. When I try to run it in Acrobat Reader 8 or 9 I get a:

NotAllowedError: Security Settings Prevent Access to the Property or Method.

My Product Information:
Acrobat Standard 9.0, Windows
Dimitri
Expert
Registered: Nov 1 2005
Posts: 1389
Hi TheWad2,

What is the script? Did you check the JavaScript Reference to see if what you are trying to do is allowed in Reader?
http://www.adobe.com/devnet/acrobat/
(under the Documentation tab on that page)

Security restrictions have changed a LOT over the last few releases of Acrobat so checking the documentation is an important part of the process when developing with Acrobat JavaScript.

Hope this helps,

Dimitri
www.windjack.com
www.pdfscripting.com
TheWad02
Registered: Jul 31 2008
Posts: 6
Dimitri,

Thanks for the fast response; I am looking into Security Restrictions now! I have included the script in question and it is placed in "Will Print":

this.addWatermarkFromText({
cText: util.printd("mmmm d, yyyy", new Date()),
aColor: color.ltGray,
nRotation: 45,
nFontSize: 60,
nTextAlign: app.constants.align.center,
nHorizAlign: app.constants.align.center,
nVertAlign: app.constants.align.center,
nHorizValue: 13,
nVertValue: 13,
nStart: 0,
nEnd: this.numPages -1
});

Any suggestions on how to do it any other way would be appreciated!