• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Dynamic Stamp / Javascript

New Here ,
Nov 01, 2018 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

2.2K

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
community guidelines
Community Expert ,
Nov 01, 2018 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

Votes

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
community guidelines
Community Expert ,
Nov 01, 2018 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.

Votes

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
community guidelines
Community Expert ,
Nov 01, 2018 Nov 01, 2018

Copy link to clipboard

Copied

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

Votes

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
community guidelines
Community Expert ,
Nov 01, 2018 Nov 01, 2018

Copy link to clipboard

Copied

LATEST

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

Votes

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
community guidelines