Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
4

Apply Stamp Tool to All Pages in a PDF?

Community Beginner ,
Mar 09, 2012 Mar 09, 2012

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!

101.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 ACCEPTED SOLUTION
Community Beginner ,
Aug 01, 2014 Aug 01, 2014

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

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Mar 09, 2012 Mar 09, 2012

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jan 07, 2013 Jan 07, 2013

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 07, 2013 Jan 07, 2013

That one line should be:

for(var i=0;i < this.numPages;i++){

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jan 07, 2013 Jan 07, 2013

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 07, 2013 Jan 07, 2013

There's another error in the code. The first line should be:

var annt = this.getAnnots(this.pageNum)[0];

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jan 07, 2013 Jan 07, 2013

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 09, 2013 Oct 09, 2013

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 09, 2013 Oct 09, 2013

Are there any error messages in the console?

You should probably add a call to this.syncAnnotScan() at the top of the script.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 09, 2013 Oct 09, 2013

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 09, 2013 Oct 09, 2013
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 01, 2014 Aug 01, 2014

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 01, 2014 Aug 01, 2014

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 01, 2014 Aug 01, 2014

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 01, 2014 Aug 01, 2014

This is not valid code:


call to this.syncAnnotScan()


Use this instead:


this.syncAnnotScan();

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 01, 2014 Aug 01, 2014

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 01, 2014 Aug 01, 2014

Works fine for me. Make sure you select all the code, and just the code,

when you run it.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 01, 2014 Aug 01, 2014

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!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 23, 2014 Dec 23, 2014

How do you adjust for current page rotation and default user space?

Thanks.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 24, 2014 Dec 24, 2014

Only with a script.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 08, 2016 Jul 08, 2016

I get the below error msg

[Markup    1 0c54b1bf-eb32-4c4d-921e-ade99cd1a898]

when I try to run the code in console

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 08, 2016 Jul 08, 2016

That's not an error message, at least not a complete one. Is there any more?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 10, 2016 Jul 10, 2016

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 12, 2020 Jan 12, 2020

Complete Solution of Stamping Multiple pages of PDF in just single Click

 

http://all4u.com.pk/how-to-stamp-multiple-pages-in-pdf/ 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 04, 2019 Oct 04, 2019
Thanks for posting. The above code works.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines