简体   繁体   English

Javascript在Adobe Reader中有效,但在Nitropdf中无效

[英]Javascript works in Adobe Reader but not in Nitropdf

I have setup an interactive PDF form with a Javascript button to submit the form by email, extracting data input by the user. 我设置了一个带有Javascript按钮的交互式PDF表单,以通过电子邮件提交表单,提取用户输入的数据。 The button works fine in Adobe Reader but does nothing in NitroPDF. 该按钮在Adobe Reader中可以正常工作,但在NitroPDF中不起作用。 Is there a problem with the code (see below)? 代码是否有问题(见下文)?

 var cToAddr = this.getField("ComboBox1").value var cSubLine = "Property Transaction Form " + this.getField("Text1").value var cBody = "The attached file is the filled-out form. Please open it to review the data." this.mailDoc({bUI: true, cTo: cToAddr, cSubject: cSubLine, cMsg: cBody}) 

With the plethora of PDF viewers out there that implement only some of the Acrobat JavaScript API - some more, some less - I recommend testing for the existence of any functions that your document requires before trying to use them. 由于那里有大量的PDF查看器,它们只能实现某些Acrobat JavaScript API(更多,更少一些),因此我建议在尝试使用它们之前测试文档是否需要任何功能。 Wrap your code in the snippet below to let the user know that they are using a less capable viewer than what you've programmed the document for. 将您的代码包装在下面的代码段中,以使用户知道他们所使用的查看器比您为文档编写的功能要弱。

if (typeof this.mailDoc == 'function') { 
  // The viewer can mail documents 
}
else {
  // Warn the user somehow
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM