I have created a form in Acrobat that includes a submit button. When the user clicks it I want certain fields to be exported as tab delimited text. In Acrobat, when the button is clicked the window opens, allowing me to select the folder to export into, and the data is exported. In reader nothing happens. The debugger gives me this error:
RangeError: Invalid argument value.
Doc.exportAsText:2:Field Submit:Mouse Up
I've looked and can't seem to find information on this error. My original script is this:
var aSubmitFields = new Array ( "Name", "Address")
this.exportAsText ({aFields: aSubmitFields})
As you can see it's very basic. I don't understand why it will not work.
EDIT: after removing the "a" from ({aFields
I get the error:
NotAllowedError: Security settings prevent access to this property or method.
Doc.exportAsText:2:Field Submit:Mouse Up
To enable JavaScript in Adobe Acrobat Reader Open Adobe Acrobat Reader. Go to Edit > Preferences. In Categories, click JavaScript. In the JavaScript section, check Enable Acrobat JavaScript.
Update Acrobat Reader or Acrobat Installing the latest updates might solve the issue. Open Acrobat Reader or Acrobat. Select Help > Check for Updates. If the Updater dialog box appears, click Yes.
A JavaScript action allows execution of JavaScript code embedded in the PDF document. Essential PDF supports adding JavaScript action to the PDF document in the following: Document level JavaScript action.
To open the Document Actions dialog, choose Tools > JavaScript > Document Actions. Select an action and then click Edit to add the script to the action.
To achieve this in Acrobat Reader first user will open tools>preferences, there user will see the security settings. Here first need to allow active contents
to run
After doing this your code should work, the active contents like JavaScript are exploited by malicious users so this feature is disabled by default.
New versions with HotFix installed will not allow JavaScript, every time security hot fix applied it will disable the JavaScript/Active Content option..
I hope this will give you some insights towards solution..
To be able to call exportAsText() in Adobe Reader you need to have "Advanced Forms Features rights" on document. You can see it in documentation pages 32 and 251. If you do not have this right on document you are calling JavaScript code on you will get "Security settings prevent access to this property or method." error.
This rights can be set when the document is created in Adobe Acrobat.
And the active content must be allowed in reader as the MarmiK already tell you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With