Skip to main content
Participant
November 1, 2018
Question

Dynamic Stamp / Javascript

  • November 1, 2018
  • 1 reply
  • 3102 views

Hello,

I am trying to create a custom stamp, that once applied, will prompt the user for more information.  In this case, once I apply the stamp, I want to pop up a Javascript window asking for PO number and traceability number.  Is there anyway to do this?

Thank you in advance!

This topic has been closed for replies.

1 reply

Karl Heinz  Kremer
Community Expert
Community Expert
November 1, 2018

A dynamic stamp will prompt you for information at the time it is applied, and you cannot change that information once the stamp is placed in your document.

See here for a tutorial about custom dynamic stamps: https://acrobatusers.com/tutorials/dynamic_stamp_secrets

Joel Geraci
Community Expert
Community Expert
November 1, 2018

"you cannot change that information once the stamp is placed in your document."

That's not precisely true. After getting the properties of the stamp, delete the APCosObj property from the Object and use it to set the stamp properties. The stamp JavaScript will then rerun.

If you select the stamp you want to change the data on and run the following script, the stamp code will rerun.

var stamp = this.selectedAnnots[0];

var props = stamp.getProps();

delete props.APCosObj;

stamp.setProps(props);

The data that you already entered won't be set in the dialog but there are ways around that too.

Karl Heinz  Kremer
Community Expert
Community Expert
November 1, 2018

I should have said that there is no documented way of to change the data