javascript - TypeError: this.ExportDataObject is not a function - Stack Overflow

I have a simple pdf file containing an embedded file (test.xml) I'm trying to add a JS to call it

I have a simple pdf file containing an embedded file (test.xml) I'm trying to add a JS to call it once the pdf file is opened (even with notification to user to accept the risk etc). I've read that to perform that, the JS that should be used is this:

this.ExportDataObject({cName:"test.xml", nLaunch:2});

For some reason, it is not working. I checked the debug js console on my Acrobat reader DC (version 2021.001.20145) the the error shown is TypeError: this.ExportDataObject is not a function. I'm not sure why on my "this" object the ExportDataObject is not available... I think it should be available always, shouldn't it? I also tested without the this. and the error is different ReferenceError: ExportDataObject is not defined.

That makes to think to me that this.ExportDataObject is existing but is not a function as the original error said... but, if is not a function, what is? a typeof is showing "undefined". Not sure how to make this work. Not sure if next steps should more JS debugging or if the problem is related to something on pdfs or Acrobat. Any help? thanks.

I have a simple pdf file containing an embedded file (test.xml) I'm trying to add a JS to call it once the pdf file is opened (even with notification to user to accept the risk etc). I've read that to perform that, the JS that should be used is this:

this.ExportDataObject({cName:"test.xml", nLaunch:2});

For some reason, it is not working. I checked the debug js console on my Acrobat reader DC (version 2021.001.20145) the the error shown is TypeError: this.ExportDataObject is not a function. I'm not sure why on my "this" object the ExportDataObject is not available... I think it should be available always, shouldn't it? I also tested without the this. and the error is different ReferenceError: ExportDataObject is not defined.

That makes to think to me that this.ExportDataObject is existing but is not a function as the original error said... but, if is not a function, what is? a typeof is showing "undefined". Not sure how to make this work. Not sure if next steps should more JS debugging or if the problem is related to something on pdfs or Acrobat. Any help? thanks.

Share Improve this question asked Mar 31, 2021 at 17:22 OscarAkaElvisOscarAkaElvis 5,7444 gold badges34 silver badges57 bronze badges 0
Add a ment  | 

3 Answers 3

Reset to default 8 +50

Javascript function names are case-sensitive and as documented by Adobe (p. 151), the correct spelling is exportDataObject() without the leading capitalization.

I believe you misspelled ExportDataObject()

It should be exportDataObject()

Using Javascript you should be careful as it is easy to mess up spelling as JS will interpret that in different ways.

As like most of the languages, js is also case sensitive.

But ReferenceError: ExportDataObject is not defined, ReferenceError always states that the object is not defined at all, and could'nt be found among the class methods.

so you need to make sure the function with the exact exportDataObject name is present and use them accordingly.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745563218a4633233.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信