Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Hi Alex,
I'm not sure that it can be done as a Comment, but it can be done as a Button.
Here's a second method:
Does either of these methods work for you?
~ Jane
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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)
Copy link to clipboard
Copied
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);
Copy link to clipboard
Copied
Thank you. That did the job.
Copy link to clipboard
Copied
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