Skip to main content
Participant
Dec 30, 2019 6:55 PM UTC
Question

Apply dynamic custom stamp on PDFs

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 is closed to new replies. Start a new post to keep the conversation going.

3 replies

JR Boulay
Community Expert
Community Expert
Feb 14, 2020 3:03 PM UTC
Thom Parker
Community Expert
Community Expert
Dec 30, 2019 8:32 PM UTC

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

 

 

Translate
Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
try67
Community Expert
Community Expert
Dec 30, 2019 7:43 PM UTC

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

Translate