0

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 ?

Dante1986
  • 58,291
  • 13
  • 39
  • 54

2 Answers2

2

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.

joelgeraci
  • 4,606
  • 1
  • 12
  • 19
0

I don't think you can make the stamp regenerate if it is scraped off of one document and placed into another. A person knowledgeable enough to do so could as easily scrape off that JavasScript code from the stamp.

What you could potentially do is immediately after you add the stamp, call the doc.timestampSign method so that the timestamp signature is reasonably and consistently close to stamp's time stamp. So that a document that's assembled by scraping the stamp from another document might not have the timestamp, or the information captured in the timestamp signature might be off compared to a valid timestamp signature.

In short, it would be the combination of the stamp with the timestamp signature that would validate a document as a counter-fraud measure rather than just the stamp alone.

Patrick Gallot
  • 595
  • 3
  • 11