In adobe pro, i have a dynamic stamp that puts in the username + time when the stamp is placed. This gets generated by some javascript that looks something like this:
event.value = identity.name + ” at ” + util.printd(“h:MM tt, mmm dd, yyyy”,new Date());
When the stamp gets placed on a document, the field gets filled with the username and time. When when someone copy an already placed stamp, and pastes it into another document, it will have the info from that first placed stamp, and its not fresh generated when pasted in a new document. So to make it fraude proof, im looking for some way to make the code run again also when the stamp is placed again through copy-pasting.
Is this possible through the javascript ? Maybe build in some check or something ?
The only way to "rerun" the JavaScript that populates the fields in the stamp is to use JavaScript on the document object, get the annotation, and then delete the AP property of the annot. This will cause the annotation to regenerate it's appearance which then executes the JavaScript.
However, if fraud prevention is what you're after, I'd recommend using digital signatures since JavaScript can be turned off, the stamp copied to the new file, then JavaScript turned back on. A digital signature field can be copied, but it won't validate in the new file.