获取复选框的数据形式的用户,并在Adobe Acrobat检查动态图章 [英] Getting checkbox data form user and checking dynamic stamp in Adobe Acrobat

查看:227
本文介绍了获取复选框的数据形式的用户,并在Adobe Acrobat检查动态图章的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我建立在Acrobat一个动态图章。它有5个复选框,三个文本字段。我有文本字段罚款,弹出对话框,询问姓名,项目,他们填写它,它填补了领域。其他文本框是我拉动态的日期。该复选框的麻烦。我知道与检查它们:

I am building a dynamic stamp in Acrobat. It has 5 check boxes, and three text fields. I have the text fields fine, a dialog box pops up, ask Name, Project, they fill it in and it fills in the fields. The other text box is the date which I pull dynamically. The check boxes are the trouble. I know to check them with :

var f = this.getField("cb10");
f.checkThisBox(0,true);

把我不知道如何将在对话框中的选项,并将其链接到印章盒。 任何帮助非常AP preciated。

Put I don't know how to include the choices in the dialog box and link them to the stamp box. Any help greatly appreciated.

修改

我想出了这一点:

    var DiaBox =
{

result:"cancel",
DoDialog: function(){return app.execDialog(this);},
bChk1:false,
bChk2:false,
bChk3:false,
bChk4:false,
bChk5:false,
stredt1:"",
stredt2:"",
initialize: function(dialog)
{
var dlgInit = 
{
"Chk1": this.bChk1,
"Chk2": this.bChk2,
"Chk3": this.bChk3,
"Chk4": this.bChk4,
"Chk5": this.bChk5,
"edt1": this.stredt1,
"edt2": this.stredt2,
};
dialog.load(dlgInit);
},
commit: function(dialog)
{
var oRslt = dialog.store();
this.bChk1 = oRslt["Chk1"];
this.bChk2 = oRslt["Chk2"];
this.bChk3 = oRslt["Chk3"];
this.bChk4 = oRslt["Chk4"];
this.bChk5 = oRslt["Chk5"];
this.byName = oRslt["edt1"];
this.projNum = oRslt["edt2"];
},
description:
{
name: "Stamp",
elements:
[
{
type: "view",
elements:
[
{
type: "view",
char_height: 10,
elements:
[
{
type: "static_text",
item_id: "stat",
name: "Check only ONE box:",
width: 152,
height: 23,
char_width: 15,
alignment: "align_fill",
font: "dialog",
},
{
type: "check_box",
item_id: "Chk1",
name: "Approved",
},
{
type: "check_box",
item_id: "Chk2",
name: "Approved as Noted - Proceed",
},
{
type: "check_box",
item_id: "Chk3",
name: "Revise and Resubmit",
},
{
type: "check_box",
item_id: "Chk4",
name: "Not a required submittal - not Reviewed",
},
{
type: "check_box",
item_id: "Chk5",
name: "Rejected - Do Not Use",
},
{
type: "static_text",
item_id: "sta1",
name: "Project Number",
alignment: "align_row",
},
{
type: "edit_text",
item_id: "edt1",
char_width: 20,
char_height: 6,
alignment: "align_left",
},
{
type: "static_text",
item_id: "sta2",
name: "Name:",
},
{
type: "edit_text",
item_id: "edt2",
char_width: 20,
alignment: "align_left",
font: "palette",
},
]
},
{
type: "ok_cancel",
},
]
},
]
}
};

// Example Code
DiaBox.bChk1 = false;
DiaBox.bChk2 = false;
DiaBox.bChk3 = false;
DiaBox.bChk4 = false;
DiaBox.bChk5 = false;
DiaBox.stredt1 = "";
DiaBox.stredt2 = "";

if(event.source.forReal && (event.source.stampName == "#bsiloE85pqFs4ntcdBQCMC"))
{
  if ("ok" == app.execDialog(DiaBox))
  {
    var cMsg = DiaBox.byName;
    event.value = "Project # " + cMsg;
    event.source.source.info.exhibit = cMsg;

    cMsg = "By: " + DiaBox.projNum;
    this.getField("byNameField").value = cMsg;

    this.getField("cbx1").checkThisBox(0, DiaBox.bChk1);
    this.getField("cbx2").checkThisBox(0, DiaBox.bChk2);
    this.getField("cbx3").checkThisBox(0, DiaBox.bChk3);
    this.getField("cbx4").checkThisBox(0, DiaBox.bChk4);
    this.getField("cbx5").checkThisBox(0, DiaBox.bChk5);
  }
}

它在Acrobat的伟大工程,但在阅读器中,通过Name字段和复选框没有得到填充。我不能让读者在一个调试器,所以我有一个问题跟踪问题。任何人都可以看到它可能是什么?

It works great in Acrobat, but in reader, the By Name field and check boxes don't get populated. I can't get a debugger in reader, so I have an issue tracking the problem. Can anyone see what it might be?

推荐答案

由于这是现在即将在搜索在谷歌上面,我会告诉你我做什么,这是不完美的或优雅,但它的作品。

Since this is now coming up in the top of searches on Google, I will show you what I did, it is not perfect or elegant, but it works.

{
name: "Stamp",
elements:
[
{
type: "view",
elements:
[
{
type: "view",
char_height: 10,
elements:
[
{
type: "static_text",
item_id: "stat",
name: "Check only ONE box:",
width: 152,
height: 23,
char_width: 15,
alignment: "align_fill",
font: "dialog",
},
{
type: "check_box",
item_id: "Chk1",
name: "Approved",
},
{
type: "check_box",
item_id: "Chk2",
name: "Approved as Noted - Proceed",
},
{
type: "check_box",
item_id: "Chk3",
name: "Revise and Resubmit",
},
{
type: "check_box",
item_id: "Chk4",
name: "Not a required submittal - not Reviewed",
},
{
type: "check_box",
item_id: "Chk5",
name: "Rejected - Do Not Use",
}
]
},
{
type: "ok_cancel",
},
]
},
]
}
};

// Example Code
//DiaBox.bChk1 = false;
//DiaBox.bChk2 = false;
//DiaBox.bChk3 = false;
//DiaBox.bChk4 = false;
//DiaBox.bChk5 = false;
//DiaBox.stredt1 = "";
//DiaBox.stredt2 = "";

if(event.source.forReal && (event.source.stampName == "#bsiloE85pqFs4ntcdBQCMC"))
{
  if ("ok" == app.execDialog(DiaBox))
  {

    this.getField("cbx1").checkThisBox(0, DiaBox.bChk1);
    this.getField("cbx2").checkThisBox(0, DiaBox.bChk2);
    this.getField("cbx3").checkThisBox(0, DiaBox.bChk3);
    this.getField("cbx4").checkThisBox(0, DiaBox.bChk4);
    this.getField("cbx5").checkThisBox(0, DiaBox.bChk5);
  }
}

if ("ok" == app.execDialog(DiaBox))
  {
    var cMsg = DiaBox.byName;
    event.value = "Project # " + cMsg;
    event.source.source.info.exhibit = cMsg;
  }

分隔JS的箱子,这是我能捕捉到数据邮票的唯一途径。

Which separates the JS boxes, which was the only way I could capture the data for the stamp.

这篇关于获取复选框的数据形式的用户,并在Adobe Acrobat检查动态图章的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆