constant.states Security Issue
I'm working in Acrobat X, but users are using a variety of Acrobat and Reader of every version. A client needed a PDF to ship with layers turned off, but be returned with layers turned on. After I added this to the script that displays the PDF results, then saved the PDF with Reader Extended PDF>Enable Additional Features:
if (layers.state == true){
layers.initState = layers.constants.states.on;
}else{
layers.initState = layers.constants.states.off;
}
...the regular PDF worked fine in Acrobat, but the Reader Extended version stops execution with the message:
Acrobat EScript Built-in Functions Version 10.0
Acrobat SOAP 10.0
NotAllowedError: Security settings prevent access to this property or method.
OCG.initState:11:Field Finalizar:Mouse Up
The error message tells us nothing, but when I comment out the lines that switch the constant.states status, the error goes away. But then the layers are not visible when the head office gets the PDF back.
I've looked this up in the Acrobat SDK, but constants.states does not seem to be a high-security command. Does anyone have an idea how to avoid the security problem, or how to change the layer visiblity without having to install a folder-level script on every damn user's computer? Thanks for any help.
