Page rotation script does not (not allowed error security settings prevent access to this property)

Hello

I use a script to rotate each pages in pdf format by clicking on a button. I added a script to rotate the file in the click event of the button turn as a javascript. It works in acrobat, but not in adobe reader. Please see the script

Start = 0;

nEnd = this.numPages - 1;

nRotate = 90;
Try
{
If (this.numPages > 0)
{
this.setPageRotations (start, nEnd, nRotate)
}
}
catch (e)
{
App.Alert ("processing error:" + e)
}

But I get this error in adobe reader not in acrobat. "not authorized error security settings prevent access to this property or method". What is the problem. Please someone tell me.

OK, so here's what you do:

-Create a new file in a plain-text editor (I recommend Notepad ++) and paste this code:

safeExecMenuItem = {app.trustPropagatorFunction (function (code)}

app.beginPriv ();

app.execMenuItem (code);

app.endPriv ();

});

mySafeExecMenuItem = {app.trustedFunction (function (code)}

app.beginPriv ();

safeExecMenuItem (code);

app.endPriv ();

});

Close the player if it was open and then save this file as "MyScripts.js" and place it in the following directory (this is for Windows):

C:\Program Files (x 86) \Adobe\Reader 11.0\Reader\Javascripts

If you want it to run as well in format Acrobat place the file also less:

C:\Program Files (x 86) \Adobe\Acrobat 11.0\Acrobat\Javascripts

Now to rotate the page clockwise attach this code to your button (in Acrobat, of course):

mySafeExecMenuItem ("RotateCW");

And to turn them counterclockwise, use this code:

mySafeExecMenuItem ("RotateCCW");

Open your file in the player and the buttons should turn pages when you click on it...

Tags: Acrobat

Similar Questions

Maybe you are looking for