常用JavaScript集锦

//获取签名信息
 var oState =event.target.getField("form1[0].#subform[0].SignatureField1[0]").signatureValidate();
 //Get the field's signed state.
 if (oState == 0) {...}
//提交时能否从浏览器打开网页
app.launchURL("http://www.adobe.com",true);
//调用别人的事件
abc.sf2.sf11.lend.execEvent("exit");
一些属性
Scripting > Scripting Reference > Scripting Properties
//执行菜单里面的功能
app.execMenuItem("SaveAs");
//添加另外一个判断button隐藏功能button
var vSignature=event.target.getField("abc[0].ss8[0].companysignature[0]").signatureInfo(); 
  
  if(vSignature.numRevisions==1){  
   xfa.host.messageBox("发送回执");
   
  }else{
   xfa.host.messageBox("请在“开户单位数字签名”处正确签名后再提交!签名失效请重新签名!");
  }
//获取附件并保存
var d = event.target.dataObjects;
if (d != null)
      for (var i = 0; i < d.length; i++)
      {
            event.target.exportDataObject(d[i].name);
       }
      
//去除签名 
var signatureField=event.target.getField("abc[0].ss8[0].companysignature[0]");
 xfa.signature.clear(signatureField, 0);------待验证没实现
//验证签名是否正确
Reference_Syntax.verify( OBJECT param1 [, BOOLEAN param2 [, OBJECT param3 [, OBJECT param4 ] ] ] )
0 Signature is blank.
1 Unknown status. In this case, no attempt to validate the signature was made. One possible cause is a software or hardware issue that is preventing the validation from occurring.
2 Signature is invalid.
3 Signature is valid, but the identity of the signer could not be verified.
4 Signature is valid and the identity of the signer is valid.

//使用button发送邮件
event.target.submitForm({cURL: "mailto:abc@mail.abc.com”,

                                        bEmpty: true,      // Post all fields (true), or do Not post all fields (false)

                                        cSubmitAs: "XDP",  // Post XDP format

                                        cCharset: "utf-8"});

event.target.submitForm(cURL:"mailto:abc@abc.com",
          bEmpty:true,
          cSubmitAs:"PDF",
          cCharset:"utf-8"
          );

//设置权限
  abc.sf2.sf11.borrow.access="protected";
   abc.sf2.sf11.lend.access="protected";
  
abc.sf2.sf11.borrow.access="readOnly";
abc.sf2.sf11.lend.access="readOnly";

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值