Skip to content
Advertisement

TypeError: this.ExportDataObject is not a function

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.

Advertisement

Answer

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

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement