Dynamic Stamp / Javascript

New Here ,
Nov 01, 2018

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!

TOPICS
Acrobat SDK and JavaScript, Windows

Views

788

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Dynamic Stamp / Javascript

New Here ,
Nov 01, 2018

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!

TOPICS
Acrobat SDK and JavaScript, Windows

Views

789

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Nov 01, 2018 0
Adobe Community Professional ,
Nov 01, 2018

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 01, 2018 0
Adobe Community Professional ,
Nov 01, 2018

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 01, 2018 0
Adobe Community Professional ,
Nov 01, 2018

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 01, 2018 1
Adobe Community Professional ,
Nov 01, 2018

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 01, 2018 1