Highlighted

Javascript to insert dynamic stamp

New Here ,
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.

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

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

TOPICS
Acrobat SDK and JavaScript, PDF forms, Windows

Views

3.1K

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

Javascript to insert dynamic stamp

New Here ,
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.

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

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

TOPICS
Acrobat SDK and JavaScript, PDF forms, Windows

Views

3.1K

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
Jun 13, 2016 0
Most Valuable Participant ,
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.

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

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...
Jun 13, 2016 0
Most Valuable Participant ,
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

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...
Jun 13, 2016 0
New Here ,
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" });

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...
Jun 13, 2016 0
Most Valuable Participant ,
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.

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

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

Copy link to clipboard

Copied

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

Thanks

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...
Jun 14, 2016 0
Most Valuable Participant ,
Jun 14, 2016

Copy link to clipboard

Copied

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

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

Copy link to clipboard

Copied

Thanks....got AP value

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

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

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...
Aug 19, 2020 0
New Here ,
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]," ?

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...
Aug 19, 2020 0
try67 LATEST
Most Valuable Participant ,
Aug 19, 2020

Copy link to clipboard

Copied

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.

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...
Aug 19, 2020 0
Adobe Community Professional ,
Jun 13, 2016

Copy link to clipboard

Copied

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