Skip to main content
Participant
February 29, 2020
Answered

Copying Comments To Every Page

  • February 29, 2020
  • 3 replies
  • 19225 views

I have a PDF, and I've created a rectangle using the Comment tool. I want to copy this shape to every page of a many-page document so it's in the same place on every page. Copy and paste doesn't preserve the position. 

Anyone know how to do this?

 

Thanks. 

This topic has been closed for replies.
Correct answer Thom Parker

Here's a short script that can be run from the console window.

It copies the currently selected comment to all pages of the PDF

 

var props = this.selectedAnnots[0].getProps();

var nPg = props.page;

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

     if(nPg != i) {props.page = i;this.addAnnot(props)}

 

You'll find a tutorial on the Console Window here:

https://www.pdfscripting.com/public/Free_Videos.cfm#JSIntro

 

3 replies

try67
Community Expert
Community Expert
February 29, 2020

You can use this (paid-for) tool I've developed to do it with a single click:

http://try67.blogspot.com/2009/07/acrobat-duplicate-annotations-to.html

Thom Parker
Community Expert
Thom ParkerCommunity ExpertCorrect answer
Community Expert
February 29, 2020

Here's a short script that can be run from the console window.

It copies the currently selected comment to all pages of the PDF

 

var props = this.selectedAnnots[0].getProps();

var nPg = props.page;

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

     if(nPg != i) {props.page = i;this.addAnnot(props)}

 

You'll find a tutorial on the Console Window here:

https://www.pdfscripting.com/public/Free_Videos.cfm#JSIntro

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Participant
July 8, 2021

Hi @Thom Parker, would that be an eay tweak if I want to do the same on multi-selected annotation? (as opposed to single selected annotation)

Thom Parker
Community Expert
Community Expert
July 8, 2021

Here's the code. I put the copy to all pages script into a function, then call that function for all selected annots.

Haven't tested it, so debugging is up to you. 

 

function CopyAnnotToAllPages(oAnt)
{
   var props = oAnt.getProps();
   var nPg = props.page;
   for(var i=0;i<oAnt.doc.numPages;i++)
      if(nPg != i) {props.page = i;oAnt.doc.addAnnot(props)}
}
this.selectedAnnots.forEach(CopyAnnotToAllPages);
Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
jane-e
Community Expert
Community Expert
February 29, 2020

Hi Alex,

 

I'm not sure that it can be done as a Comment, but it can be done as a Button.

  • Rich Media Toolbar (or Forms)
  • Add Button
  • Use Properties to format the rectangle and add text if desire
  • Right-Click and Duplicate Across Pages
  • There is no easy way to edit or delete, as it is now on each page.

 

 

 

Here's a second method:

  • Use the Prepare Form toolbar
  • Draw a Text field
  • Format with Properties to have a Fill and Stroke
  • Right click and choose Duplicate Across All Pages
  • If you need text, then as long as all text boxes have the same name in Properties, then changing the text in one will update all

 

 

Does either of these methods work for you?

 

~ Jane