Copy link to clipboard
Copied
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!
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
"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.
Copy link to clipboard
Copied
I should have said that there is no documented way of to change the data
Copy link to clipboard
Copied
For clarity... the effect of deleting the APCosObj is undocumented, the property is enumerable. You can't set it, but you can delete it forcing Acrobat to essentially reapply the stamp. Actually most of the cool stuff you can do with dynamic stamps is undocumented... by Adobe... but documentation does exist.
Amazon.com: All About PDF Stamps in Acrobat® & Paperless Workflows eBook: Thom Parker: Kindle Store