最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

pdf - JavaScript working in Acrobat but not Reader - Stack Overflow

programmeradmin0浏览0评论

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

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
Share Improve this question edited May 27, 2013 at 10:54 Paras Joshi 20.6k11 gold badges59 silver badges70 bronze badges asked Oct 15, 2012 at 16:43 user1747741user1747741 1411 silver badge4 bronze badges 3
  • You need to allow Advanced Forms Features rights. help.adobe./en_US/acrobat/X/standard/using/… – Ilya Kharlamov Commented May 13, 2013 at 10:27
  • 1 Did you solve this problem in the end? – w5m Commented May 13, 2013 at 15:04
  • 1 The Wayback machine archived that link from @IlyaKharlamov web.archive/web/20130214082334/http://help.adobe./en_US/… – Fuhrmanator Commented Aug 28, 2018 at 15:41
Add a ment  | 

2 Answers 2

Reset to default 2

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.

发布评论

评论列表(0)

  1. 暂无评论