Skip to main content
wjbzone
Inspiring
March 8, 2019
Answered

Acrobat Pro DC. Automation question.

  • March 8, 2019
  • 2 replies
  • 1272 views

Want to add a stamp and a certification to documents (have to repeat this task often)

I would like to use the Action Wizard, but I don't see where adding a stamp (regular stamp not dynamic) can be done.

It looks like javascript may be the way to go, but don't know how to get started with javascript. Can someone give me a direction to start learning javascript for Acrobat?

Better yet an example of adding a stamp and certification would be a big help.

Thanks,

Billt

This topic has been closed for replies.
Correct answer wjbzone

It's important to remember that JavaScript is case-sensitive.


Thanks try67 and Bernd. Got the stamps working.

this.addAnnot({

      page: 1,

      type: "Stamp",

      AP: "#Zd5nkwcd2aDSRZVdzEaoFC",

      rect: [300, 100, 400, 150]

});

(I am now going to try the digital certification.)

2 replies

Thom Parker
Community Expert
Community Expert
March 8, 2019

Do you mean you want to secure a PDF with a digital certificate? or Sign a PDF with a digital certificate (this is usually referred to as certification?

You can read about security issues and scripting here:

Acrobat DC SDK Documentation

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
wjbzone
wjbzoneAuthor
Inspiring
March 8, 2019

I want to sign the document with a digital signature (certification). using javascript.

try67
Community Expert
Community Expert
March 11, 2019

Yes I understand I need to do stamp separately from the certification.

Thanks for the method for obtaining the internal stamp name

(highlight ; Ctrl+J; this.selectedAnnots[0].AP)

This got me a little further along. However I have two stamps that I need to use. I did the method above for both stamps and got the following names:

Stamp1

#Dt6yAundmKFuWt-c6mPXPA


Stamp2

#Zd5nkwcd2aDSRZVdzEaoFC

When I use the console to place both stamps with this command:

this.addAnnot({

      page: 0,

      type: "Stamp",

      name: "#Dt6yAundmKFuWt-c6mPXPA",

      rect: [250, 100, 350, 300]

});

this.addAnnot({

      page: 1,

      type: "Stamp",

      name: " #Zd5nkwcd2aDSRZVdzEaoFC",

      rect: [300, 100, 400, 150]

});

It places the same stamp both places.  It appears to be using the last stamp used for this command. Is this the correct way to use the command to place the stamps?


No. You need to use that value as the AP property, not as the name property. That one is assigned automatically, there's no need to set it yourself.

Thom Parker
Community Expert
Community Expert
March 8, 2019

Here is (almost) everything you need to know about placing a stamp:

PDF Page Coordinates (page size, field placement, etc.)

and all about stamps themselves here:

PDF Stamp Annotations

You can lean all about JavaScript in Acrobat here:

pdfscripting.com

Be sure to check out the free video tutorials on how JavaScript is used in Acrobat:

Free Video Content & Full Listing of Available Videos

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
wjbzone
wjbzoneAuthor
Inspiring
March 8, 2019

Thom,

Thanks for the reply. Seems this is an old topic as I see a lot of closed discussions and broken links about it. Also many links are for previous versions. (I could do this in Acrobat 9 using macromaker pro)

The link you provided above PDF Stamp Annotations is for members only. Cost $149 to read it.  May sign up later.

To add a stamp I want to use this javascript method:

this.addAnnot({

      page: 0,

      type: "Stamp",

      author: "Should I use the Category?)

      name: "How do I find this",

      rect: [100, 100, 500, 500]

});

But I need to know the name of the stamp.

This is a stamp I imported from a jpg file.

I gave the stamp a name and a category when I imported , but I understand Acrobat gave it one that I should use with the javascript. How can I find that name?