Copy link to clipboard
Copied
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.
To use this method in Reader a special Form Right has to be applied to the
file, and it can't be done with Acrobat, but with one of the LiveCycle
server applications, which are extremely expensive.
On Tue, Jul 5, 2016 at 11:08 PM, zacht17160615 <forums_noreply@adobe.com>
Copy link to clipboard
Copied
To use this method in Reader a special Form Right has to be applied to the
file, and it can't be done with Acrobat, but with one of the LiveCycle
server applications, which are extremely expensive.
On Tue, Jul 5, 2016 at 11:08 PM, zacht17160615 <forums_noreply@adobe.com>
Copy link to clipboard
Copied
Is it possible to export the data in some other way? Maybe a different format?
Copy link to clipboard
Copied
Kind of. You can display the data as plain text which the user can then copy.
See this tool I've developed that does just that: Custom-made Adobe Scripts: Adobe Reader -- Import/Export PDF Form Data
Copy link to clipboard
Copied
Not exactly the answer I wanted, but thank you for your help.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now