Played with this a little more, sorry, haven’t messed with stamps before, it should use an event callout that way it knows which file it’s looking at. Here is an example of the basic submittal approval stamp that’s built in to Revu, but modified to pull that File name. Check out the “getProjectNoFromDocName();” callout and function at the end. Let me know if this works, and if more issues, we may have to see the specific stamp file to help.
var builder =
{
// These map to Text Fields in the Stamp
textBoxes :
[
{ field: “Other – Description”, description: “Other – Description:”, default: function() { return “”; } },
{ field: “CheckedBy”, description: “Checked by:”, default: function() { return Collab.user; } },
{ field: “Date”, description: “Date:”, default: function()
{
var curDate = new Date();
return (curDate.getMonth() + 1) + “/” + curDate.getDate() + “/” + curDate.getFullYear();
}
},
{ field: “Submittal”, description: “Submittal #:”, default: function() { return event.source.source.documentFileName; } },
{ field: “Project”, description: “Project:”, default: function() { return getProjectNoFromDocName(); } }
],
// This maps to a Radio Group in the PDF named ‘Type of Submittal’
radioGroup : “Document Type”,
radioButtons :
[
// value maps to the ‘Choice’ of each radio button in the group, description will show on the dialog
{ value: “SubmittalForApproval”, description: “Submittal For Approval” },
{ value: “Resubmittal”, description: “Re-Submittal For Approval” }
],
checkBoxes :
[
{ field: “Approved” },
{ field: “Rejected” },
{ field: “Revise” },
{ field: “Not Reviewed” },
{ field: “Other” }
]
};
function getProjectNoFromDocName() {
var docName = event.source.source.documentFileName; // Access the document name correctly
return docName.slice(0, 4); // Grab the first four characters
}