this.saveAsText button Adobe Reader
Background Information
I am using Acrobat Reader DC and Adobe Acrobat XI Pro on Windows 7.
The Problem
I have an adobe form with several text fields. I would like to add a button to this form that exports the field data into a .txt file. To that end, I have placed this code in a folder level Javascript at the path "C:\Program Files (x86)\Adobe\Acrobat Reader 2015\Reader\Javascripts" :
var exportTrial = app.trustedFunction(function(){
app.beginPriv();
this.exportAsText();
app.endPriv();
});
I added a button to my form and set the action to "Run A Javascript" with
exportTrial();
as the code.
I extended rights (I believe) using File>Save As Other>Reader Extended PDF>Enable More Tools (Includes form fill-in and save).
When the form is opened in Adobe Reader, the button is visible, but when it is pushed, the console displays the following error message:
NotAllowedError: Security settings prevent access to this property or method.
Doc.exportAsText:3:Field Button:Mouse Up
As I understand it, the code I have should pop a "Save As" type dialogue box for the user to choose where to place the output file. I will eventually use the cPath argument to skip this step, but I need to get the basics working first.
If anyone can see a step I missed in this process or if you can shed some light on permission issues I may have, I would be grateful.
