Copy link to clipboard
Copied
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");
Copy link to clipboard
Copied
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).
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied