Copy link to clipboard
Copied
I have a PDF form I created in adobe acrobat pro DC on my desktop. It contains functions like this.saveAs() and app.execMenuItem("Save"). The end goal is to able to work with the form on my companies cloud server, which has acrobat reader DC. The form works when I choose to not enable protected mode on startup, but obviously the sandbox security is there for a reason so I am trying to figure out if there is a way to write my functions so that they will run with protected mode enabled. I have tried wrapping said functions in app.beginPriv() and app.endPriv(), but that did not work. Willing to share code/file if necessary.
Thank you in advance for any help.
Copy link to clipboard
Copied
Hello JoshuaPowers,
We're sorry for the trouble and for the delayed response, Acrobat and Acrobat Reader let you adjust application behavior so that JavaScript executes within your desired level of security. This helps restrict application access to JavaScript APIs and isolates workflows that do not require JavaScript APIs.
Navigate to Adobe Reader's Preferences from Edit>Preferences>JavaScript, in the JavaScript Security panel, set the options to manage JavaScript: as needed.
Enable Acrobat JavaScript: Uncheck to disable JavaScript completely or restrict JavaScript through APIs.
Enable Menu Items JavaScript Execution Privileges: Enables executing JavaScript by clicking menu items. When off, privileged JavaScript calls can be executed through the menu. Executing non-privileged JavaScript calls through menu items is not blocked whether this box is checked or not.
Enable Global Object Security Policy: Allows JavaScript globally through APIs, or trusts specific documents containing JavaScripts.
For detailed information, you may refer to JavaScripts in PDFs as a security risk
You may also refer to JavaScript Controls — Acrobat Application Security Guide
Feel free to update this discussion for any further assistance.
Thanks,
Anand Sri.
Copy link to clipboard
Copied
To enable the Save menu item you need to edit the registry, but it's not necessary. You can write a simple trusted function that uses the saveAs command to save the file under its current location. Of course, you will need to install it on the local computer of each user who is going to use this file.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more