Skip to main content
wjbzone
Inspiring
March 8, 2019
Answered

Acrobat Pro DC. Automation question.

  • March 8, 2019
  • 2 replies
  • 1267 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 8, 2019

Stamps are not a digital certification. You would need to do the two things separately. First stamp the file and then digitally sign it.

To get the internal name of a stamp add it to a page, then click it with the mouse (so a blue dashed line appears around it), then press Ctrl+J to open the JS Console and run the following script in it:

this.selectedAnnots[0].AP

It will print out the internal name of the stamp that you need to use in your code.

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?