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

Javascript to insert dynamic stamp

New Here ,
Jun 13, 2016 Jun 13, 2016

Copy link to clipboard

Copied

In PDF form, Java script for inserting dynamic stamp "Received" or "Approved" along with default author, date etc..

I have created a PDF Form button, when the button is clicked, the "Received" stamp from Dynamic stamp annotation to be inserted in the particular position. Please, let me know the java script for this action.

TOPICS
Acrobat SDK and JavaScript , Windows

Views

9.7K

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

correct answers 1 Correct answer

Community Expert , Jun 14, 2016 Jun 14, 2016

Make sure you select an applied stamp comment (using the mouse) before running this code.

Votes

Translate

Translate
Community Expert ,
Jun 13, 2016 Jun 13, 2016

Copy link to clipboard

Copied

You need to find out the AP value of that stamp and then you'll be able to do it using the addAnnot method of the Doc object.

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
New Here ,
Jun 13, 2016 Jun 13, 2016

Copy link to clipboard

Copied

Thanks, i can able to find AP value for standard stamps, but could not able to use Dynamic stamps (Received, Approved, Reviewed,..) with all features.

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 ,
Jun 13, 2016 Jun 13, 2016

Copy link to clipboard

Copied

It's exactly the same thing... Use the same method you use for the standard stamps for the dynamic ones.

I like to apply a stamp to a file and then select it and run this code from the JS console to find out its AP value:

this.selectedAnnots[0].AP

Edit: fixed the code

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
New Here ,
Jun 13, 2016 Jun 13, 2016

Copy link to clipboard

Copied

thanks, can you please explain this.selectedAnnots[0].AP

i used below js in pdf form for standard stamp "Not approved", similarly how to insert "RECEIVED" Dynamic stamp

var annot = this.addAnnot({

page: 0,

type: "Stamp",

name: "myStamp",  rect: [400, 400, 550, 500],

contents: "Received Stamp!",

AP: "NotApproved" });

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 ,
Jun 13, 2016 Jun 13, 2016

Copy link to clipboard

Copied

It just returns the AP value for the currently selected annotation.

Your code is good. You just need to adjust the AP value and you'll be set.

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
New Here ,
Jun 13, 2016 Jun 13, 2016

Copy link to clipboard

Copied

still, i could not able get AP value, can any one able to get AP value.

Thanks.

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
New Here ,
Aug 19, 2020 Aug 19, 2020

Copy link to clipboard

Copied

How do I specify a stamp in the Javascript code for a stamp that I have created or a different stamp such as the dynamic received Stamp?  Any insights.  I see that the stamps that will work are the Standard Business stamps and if I change the word "NotApproved" to one of the other standard business stamps that it will work.  I have tried "approved and draft" and those both worked but I really want it to be a dynamic stamp.

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
New Here ,
Aug 19, 2020 Aug 19, 2020

Copy link to clipboard

Copied

I finally figured out how to get the JV console to show up so that I could find out what the AP is by using: this.selectedAnnots[0].AP

 

could someone explain to me what the size and location of the stamp is specified?  I see that it is in the following jv coding but what does it mean: "name: "myStamp",  rect: [400, 400, 550, 500]," ?

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 ,
Aug 19, 2020 Aug 19, 2020

Copy link to clipboard

Copied

LATEST

The name property is not important and can be omitted. The rect property defines both the size and location of the stamp on the page. To quote the documentation:

 

The rect array consists of four numbers [xll, yll, xur, yur] specifying the lower-left x, lower-left y, upper-right
x, and upper-right y coordinates—in default user space—of the rectangle defining the location of the
annotation on the page.

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
New Here ,
Jun 14, 2016 Jun 14, 2016

Copy link to clipboard

Copied

Hi, when i use    "this.selectedAnnots[0].AP"   it shows that it is undefined.

Thanks

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 ,
Jun 14, 2016 Jun 14, 2016

Copy link to clipboard

Copied

Make sure you select an applied stamp comment (using the mouse) before running this code.

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
New Here ,
Jun 14, 2016 Jun 14, 2016

Copy link to clipboard

Copied

Thanks....got AP value

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
New Here ,
Jun 14, 2016 Jun 14, 2016

Copy link to clipboard

Copied

Hi, please let me know what is the code to delete/remove the added stamp(annotation) with specific author.

when button is clicked the stamp will appear, when another button is clicked, the same stamp to be removed.

Thanks

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 ,
Jun 13, 2016 Jun 13, 2016

Copy link to clipboard

Copied

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