Good afternoon.
I am currently working ona project to create a dynamic stamp, that would allow the user to fill our a dialog form to fill the stamp, but will also allow users to 'restamp' by saving the entered information as variables, and repopulating the stamp witht he previous information if it isn't user overwitten. This essentially allows one to 'update' the stamp when actually deleting and refilling with stored/entered info. The issue I have is that the dialog box won't even show up when the stamp is placed, and I can't fill the information. For reference I tried to follow the code for creating multi-line dialog boxes using: https://community.adobe.com/t5/acrobat-sdk-discussions/create-a-multi-line-dialog-box-in-a-dynamic-stamp/td-p/10389407 .
CODE:
if (event.source.forReal && (event.source.stampName == "#5VGSDi-y5TU9st_HVS7nkC")) {
var StampDialog = {
result: "cancel",
DoDialog: function() {
return app.execDialog(this);
},
PDTitle: "BLANK",
WATitle: "BLANK",
TDTitle: "BLANK",
SystemTitle: "BLANK",
DirTitle: "BLANK",
SECTitle: "BLANK",
TTitle: "BLANK",
RTitle: "BLANK",
CountyTitle: "BLANK",
DateTitle: "BLANK",
DBTitle: "BLANK",
SNTitle: "BLANK",
STTitle: "BLANK",
DNTitle: "BLANK",
initialize: function(dialog) {
var dlgInit = {
"PDTitle": this.PDTitle,
"WATitle": this.WATitle,
"TDTitle": this.TDTitle,
"SystemTitle": this.SystemTitle,
"DirTitle": this.DirTitle,
"SECTitle": this.SECTitle,
"TTitle": this.TTitle,
"RTitle": this.RTitle,
"CountyTitle": this.CountyTitle,
"DateTitle": this.DateTitle,
"DBTitle": this.DBTitle,
"SNTitle": this.SNTitle,
"STTitle": this.STTitle,
"DNTitle": this.DNTitle,
};
dialog.load(dlgInit);
},
commit: function(dialog) {
var oRslt = dialog.store();
this.PDTitle = oRslt["PDTitle"] || this.PDTitle;
this.WATitle = oRslt["WATitle"] || this.WATitle;
this.TDTitle = oRslt["TDTitle"] || this.TDTitle;
this.SystemTitle = oRslt["SystemTitle"] || this.SystemTitle;
this.DirTitle = oRslt["DirTitle"] || this.DirTitle;
this.SECTitle = oRslt["SECTitle"] || this.SECTitle;
this.TTitle = oRslt["TTitle"] || this.TTitle;
this.RTitle = oRslt["RTitle"] || this.RTitle;
this.CountyTitle = oRslt["CountyTitle"] || this.CountyTitle;
this.DateTitle = oRslt["DateTitle"] || this.DateTitle;
this.DBTitle = oRslt["DBTitle"] || this.DBTitle;
this.SNTitle = oRslt["SNTitle"] || this.SNTitle;
this.STTitle = oRslt["STTitle"] || this.STTitle;
this.DNTitle = oRslt["DNTitle"] || this.DNTitle;
},
// Description of the dialog layout
description: {
name: "Stamp Information Dialog",
elements: [{
type: "view",
width: 254,
height: 351,
elements: [{
type: "static_text",
item_id: "PDTs",
name: "Project Description:",
}, {
type: "edit_text",
item_id: "PDTe",
variable_Name: "PDTitle",
char_width: 20,
}, {
type: "static_text",
item_id: "WATs",
name: "Work Authorization:",
}, {
type: "edit_text",
item_id: "WATe",
variable_Name: "WATitle",
char_width: 20,
}, {
type: "static_text",
item_id: "TDTs",
name: "Tax District:",
}, {
type: "edit_text",
item_id: "TDTe",
variable_Name: "TDTitle",
char_width: 20,
}, {
type: "static_text",
item_id: "Syss",
name: "System:",
}, {
type: "edit_text",
item_id: "Syse",
variable_Name: "SystemTitle",
char_width: 20,
}, {
type: "static_text",
item_id: "Dirs",
name: "__ SEC. xx -T. xxx R. xx",
}, {
type: "edit_text",
item_id: "Dire",
variable_Name: "DirTitle",
char_width: 20,
}, {
type: "static_text",
item_id: "SECs",
name: "xx SEC. __ -T. xxx R. xx",
}, {
type: "edit_text",
item_id: "SECe",
variable_Name: "SECTitle",
char_width: 20,
}, {
type: "static_text",
item_id: "TTis",
name: "xx SEC. xx -T. ___ R. xx",
}, {
type: "edit_text",
item_id: "TTie",
variable_Name: "TTitle",
char_width: 20,
}, {
type: "static_text",
item_id: "RTis",
name: "xx SEC. xx -T. xxx R. __",
}, {
type: "edit_text",
item_id: "RTie",
variable_Name: "RTitle",
char_width: 20,
}, {
type: "static_text",
item_id: "CTis",
name: "County:",
}, {
type: "edit_text",
item_id: "CTie",
variable_Name: "CountyTitle",
char_width: 20,
}, {
type: "static_text",
item_id: "DTis",
name: "Date:",
}, {
type: "edit_text",
item_id: "DTes",
variable_Name: "DateTitle",
char_width: 20,
}, {
type: "static_text",
item_id: "DBTs",
name: "Drawn By:",
}, {
type: "edit_text",
item_id: "DBTe",
variable_Name: "DBTitle",
char_width: 20,
}, {
type: "static_text",
item_id: "SNTs",
name: "Sheet No. (current):",
}, {
type: "edit_text",
item_id: "SNTe",
variable_Name: "SNTitle",
char_width: 20,
}, {
type: "static_text",
item_id: "STTs",
name: "Sheet Total No.:",
}, {
type: "edit_text",
item_id: "STTe",
variable_Name: "STTitle",
char_width: 20,
}, {
type: "static_text",
item_id: "DNTs",
name: "Drawing No.:",
}, {
type: "edit_text",
item_id: "DNTe",
variable_Name: "DNTitle",
char_width: 20,
}, {
type: "ok_cancel", // The OK and Cancel buttons.
}]
}]
}
};
// Initialize fields with previous values or "BLANK"
StampDialog.PDTitle = this.getField("PDTitle").value || "BLANK";
StampDialog.WATitle = this.getField("WATitle").value || "BLANK";
StampDialog.TDTitle = this.getField("TDTitle").value || "BLANK";
StampDialog.SystemTitle = this.getField("SystemTitle").value || "BLANK";
StampDialog.DirTitle = this.getField("DirTitle").value || "BLANK";
StampDialog.SECTitle = this.getField("SECTitle").value || "BLANK";
StampDialog.TTitle = this.getField("TTitle").value || "BLANK";
StampDialog.RTitle = this.getField("RTitle").value || "BLANK";
StampDialog.CountyTitle = this.getField("CountyTitle").value || "BLANK";
StampDialog.DateTitle = this.getField("DateTitle").value || "BLANK";
StampDialog.DBTitle = this.getField("DBTitle").value || "BLANK";
StampDialog.SNTitle = this.getField("SNTitle").value || "BLANK";
StampDialog.STTitle = this.getField("STTitle").value || "BLANK";
StampDialog.DNTitle = this.getField("DNTitle").value || "BLANK";
// Show the dialog and process user input
if ("ok" == StampDialog.DoDialog()) {
this.getField("PDTitle").value = StampDialog.PDTitle;
this.getField("WATitle").value = StampDialog.WATitle;
this.getField("TDTitle").value = StampDialog.TDTitle;
this.getField("SystemTitle").value = StampDialog.SystemTitle;
this.getField("DirTitle").value = StampDialog.DirTitle;
this.getField("SECTitle").value = StampDialog.SECTitle;
this.getField("TTitle").value = StampDialog.TTitle;
this.getField("RTitle").value = StampDialog.RTitle;
this.getField("CountyTitle").value = StampDialog.CountyTitle;
this.getField("DateTitle").value = StampDialog.DateTitle;
this.getField("DBTitle").value = StampDialog.DBTitle;
this.getField("SNTitle").value = StampDialog.SNTitle;
this.getField("STTitle").value = StampDialog.STTitle;
this.getField("DNTitle").value = StampDialog.DNTitle;
}
}