Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

this.saveAsText button Adobe Reader

Guest
Jul 05, 2016 Jul 05, 2016

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.

TOPICS
Acrobat SDK and JavaScript , Windows
1.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jul 05, 2016 Jul 05, 2016

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>

Translate
Community Expert ,
Jul 05, 2016 Jul 05, 2016

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>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 05, 2016 Jul 05, 2016

Is it possible to export the data in some other way? Maybe a different format?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 05, 2016 Jul 05, 2016

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 06, 2016 Jul 06, 2016
LATEST

Not exactly the answer I wanted, but thank you for your help.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines