Adobe Acrobat script

Associate
Joined
7 Nov 2005
Posts
499
Hi All,

I am trying to stamp a document using the same custom stamp but automatically repeat for all pages. It seems the script below from this website would work but I cannot seem to get it to work. Hopefully some very smart person can help where I am going wrong.

https://community.adobe.com/t5/Acrobat/Apply-Stamp-Tool-to-All-Pages-in-a-PDF/td-p/3969086

I am pasting all the below in Console window but just keep getting SyntaxError: syntax error

Any help much appreciated it will save me hours per month

this.syncAnnotScan();
var annt = this.getAnnots(this.pageNum)[0];
var props = annt.getProps();
for(var i=0;i < this.numPages;i++){
props.page = i;
if(i != this.pageNum)
this.addAnnot(props);
}
 
Associate
Joined
24 Mar 2011
Posts
306
Location
Sherwood Forest
Never used that code but it is very small andnyou could figure it out.

Do one line of code at a time before the loop and display the contents of the object in console to see if it matches what it should, not empty etc

You can then run the loop but instead of doing something, print the object

Lastly, i dont know the syntax but double check the if statement (im used to .net, c#, python, java)

Or does .page need to be .page()
 
Back
Top Bottom