These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Dynamic Stamp working in Acrobat some fields not in Reader

TheNational22
Registered: Nov 29 2011
Posts: 3

I have a stamp that I threw together that worked fine in Acrobat, but in Reader, the fields for the check boxes and for the Name do not get placed on the stamp from the JS dialogue. I am not sure why.
 
Here is the code:
 
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);
}
}
 
So like I said, this is working as it should in Acrobat, but in Reader, the Check boxes and the "By :" field are not getting populated. Thank you in advance for nay guidance.

My Product Information:
Reader 9.4, Windows
try67
Expert
Registered: Oct 30 2008
Posts: 2398
Maybe you should post the full code...

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

TheNational22
Registered: Nov 29 2011
Posts: 3
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",
},
]
},
]
}
};
TheNational22
Registered: Nov 29 2011
Posts: 3
So I chucked out the second field, I can just get that from the document data anyways. SO now it is just the checkboxes. I even added them to their own if statement, so it looks like this:


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;
}
if ("ok" == DiaBox.DoDialog())
{
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 run in Acrobat, the dialog pops up twice, which it should, and both end up on the document. In Reader, only once and the check box isn't applied to the document.