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

Javascript to insert dynamic stamp

New Here ,
Jun 13, 2016 Jun 13, 2016

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
11.3K
Translate
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.

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

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.

Translate
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

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.

Translate
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

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

Translate
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

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" });

Translate
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

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.

Translate
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

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

Thanks.

Translate
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

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.

Translate
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

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]," ?

Translate
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
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.

Translate
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

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

Thanks

Translate
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

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

Translate
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

Thanks....got AP value

Translate
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

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

Translate
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

Hi.

You should see this tuto: https://acrobatusers.com/tutorials/creating-a-custom-dynamic-stamp-infographic


Acrobate du PDF, InDesigner et Photoshopographe
Translate
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