Copy link to clipboard
Copied
Is there a way to have Acrobat Pro X apply a stamp to all pages in a document? For example, if I am sent a set of plans that I want to mark "Not Approved", is there a way to click the Not Approved Stamp on page one and have it apply to all pages in the document?
Thanks!
Copy link to clipboard
Copied
Hi Again,
Thanks for replying so fast. I now tried the below code as you suggested but it still gave a syntax error. I am copying/pasting all information from the console:
// Assume that the stamp is the only
// annot on the page
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);
}
SyntaxError: syntax error
1:Console:Exec
undefined
Copy link to clipboard
Copied
Thom Parker had a solution of sorts on AcrobatUsers.com:
http://acrobatusers.com/forum/javascript/automatically-add-stamp-all-pages-pdf/
Hope it helps you out.
Copy link to clipboard
Copied
Hi Sabian, have you gotten this work?
I copied the following script (below) from the thread, but can't seem to get it to work...
// Assume that the stamp is the only// annot on the page
var annt = this.getAnnot(this.pageNum)[0];
var props = annt.getProps();
for(var i=0;i lt this.numPages;i++){
props.page = i;
if(i != this.pageNum)
this.addAnnot(props);
}
I ran it the java consule but it gives me an error about missing an ;
Not sure whats wrong.
Copy link to clipboard
Copied
That one line should be:
for(var i=0;i < this.numPages;i++){
Copy link to clipboard
Copied
i tried that before (changing lt to <) but if still get an error.
I'm not sure if I'm doing something wrong, but I opened a 2 page PDF, placed a stamp on the first page, and then opened the java console and pasted the code...
The error returned is:
MissingArgError: Missing required argument.
Doc.getAnnot:1:Console undefined:Exec
===> Parameter cName.
undefined
Copy link to clipboard
Copied
There's another error in the code. The first line should be:
var annt = this.getAnnots(this.pageNum)[0];
Copy link to clipboard
Copied
George,
That did the trick.
If I was as well-versed in Acrobat javascript, I would have caught that small error. Hopefully, this will help someone else in the near future.
Thank you for your input.
S
Copy link to clipboard
Copied
I have used this script a lot lately then all of the sudden it has stopped working. Is there anything I could be doing wrong?
I am using:
// Assume that the stamp is the only
// annot on the page
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);
}
Thank you for your help.
Copy link to clipboard
Copied
Are there any error messages in the console?
You should probably add a call to this.syncAnnotScan() at the top of the script.
Copy link to clipboard
Copied
That was perfect it just needed a call function.
Thank you for your help. Is there a good place to look up Java script commands for adobe?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Hello guys,
I was trying to use the below code in order to apply the same stamp (that has already been added to the first page) to all pages in the PDF document.
// Assume that the stamp is the only
// annot on the page
call to 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);
}
Well since I don't usually use javascripts I cannot understand whether the above will work regardless of the name of the stamp, or whether I should add the call to this.syncAnnotScan() somewhere else. I tried a few variations of putting the above funciton somehwere elese like on top but I got the below errors during my tries:
MissingArgError: Missing required argument.
Doc.getAnnot:1:Console undefined:Exec
===> Parameter cName.
undefined
SyntaxError: syntax error
1:Console:Exec
undefined
undefined
Can someone advise me what the code order should be, whether the syntax is correct and if there is anything I should change in order to add the stamp name to the code script.
Your help is highly appreciated.
Thanks
Copy link to clipboard
Copied
The error message is about getAnnot, but in the code you posted this method is not used. Are you sure the code you posted is actually the code you're using?
Copy link to clipboard
Copied
Hi,
I've tried a few variations of the code but nothing worked. The code I tried with is:
// Assume that the stamp is the only
// annot on the page
call to 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);
}
The error that it returned for it is:
SyntaxError: syntax error
1:Console:Exec
undefined
Copy link to clipboard
Copied
This is not valid code:
call to this.syncAnnotScan()
Use this instead:
this.syncAnnotScan();
Copy link to clipboard
Copied
Hi Again,
Thanks for replying so fast. I now tried the below code as you suggested but it still gave a syntax error. I am copying/pasting all information from the console:
// Assume that the stamp is the only
// annot on the page
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);
}
SyntaxError: syntax error
1:Console:Exec
undefined
Copy link to clipboard
Copied
Works fine for me. Make sure you select all the code, and just the code,
when you run it.
Copy link to clipboard
Copied
Hi again,
Thanks a lot - didn't realize that - such a silly thing. It works perfectly now and will save me a couple of hours work every month.
Cheers!
Copy link to clipboard
Copied
How do you adjust for current page rotation and default user space?
Thanks.
Copy link to clipboard
Copied
Only with a script.
Copy link to clipboard
Copied
I get the below error msg
[Markup 1 0c54b1bf-eb32-4c4d-921e-ade99cd1a898]
when I try to run the code in console
Copy link to clipboard
Copied
That's not an error message, at least not a complete one. Is there any more?
Copy link to clipboard
Copied
Sorry... it gives the mark up message but works fine...
But is there any way I can add this to custom calculation script of a particular stamp. I have a dynamic stamp with some details... I want that to be sealed in all pages when the user stamps it in document. They may not be able to run the script in console individually.
Copy link to clipboard
Copied
Complete Solution of Stamping Multiple pages of PDF in just single Click
Copy link to clipboard
Copied