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.
Make sure you select an applied stamp comment (using the mouse) before running this code.
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.
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.
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
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" });
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.
Copy link to clipboard
Copied
still, i could not able get AP value, can any one able to get AP value.
Thanks.
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.
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]," ?
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.
Copy link to clipboard
Copied
Hi, when i use "this.selectedAnnots[0].AP" it shows that it is undefined.
Thanks
Copy link to clipboard
Copied
Make sure you select an applied stamp comment (using the mouse) before running this code.
Copy link to clipboard
Copied
Thanks....got AP value
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
Copy link to clipboard
Copied
Hi.
You should see this tuto: https://acrobatusers.com/tutorials/creating-a-custom-dynamic-stamp-infographic