Skip to main content
Participant
December 30, 2019
Question

Apply dynamic custom stamp on PDFs

  • December 30, 2019
  • 3 replies
  • 620 views

Hi,

 

Is it possible to apply a dynamic custom stamp to every pages of a PDF file, print it, and then save it?

I already have the following working in javascript console, and I would like to be able to apply the following code to many PDFs not involving the javascript console so my user don't have to copy/paste the code in the javascript console.

 

for(var j=0;j < this.numPages; j++){
this.addAnnot({
page: j,
type: "Stamp",
author: "cyeung4",
name: "BERS Time Stamp",
rect: [454, 510, 538, 641],
AP: "#ZJ1LQSvWRiacxXY_xMhkgC" });
}

this.print({
bUI: false,
bSilent: true,
});

app.execMenuItem("Save");

This topic has been closed for replies.

3 replies

JR Boulay
Community Expert
Community Expert
February 14, 2020
Thom Parker
Community Expert
Community Expert
December 30, 2019

The answer is Yes, and it looks like you already have a script to do it. Although I wouldn't use the Save menu item.

See this article on automation scripts for Acrobat.

 

https://www.pdfscripting.com/public/Automating-Acrobat.cfm

 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
try67
Community Expert
Community Expert
December 30, 2019

If you have Acrobat Pro you can run that code on multiple files as a part of an Action, via Tools - Action Wizard.

It also has a built-in command for saving the file and printing it, although you can also do that in your script (not with the execMenuItem command, though).