Copy link to clipboard
Copied
Hi guys,
Hoping you can help.
For a while now i have been using some javascript to replicate stamps across all pages
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);
}
However now i have the issue of having 2 stamps i need to replicate and this code will only replicate the first stamp i place does anyone know what i need to insert to get this to replicate both stamp?
That's not enough to create a reliable script. I would suggest you use this code, but then it means you have to first select the stamp(s) (or any other comments for that matter) before running it:
this.syncAnnotScan();
var annots = this.selectedAnnots;
if (annots!=null) {
for (var i in annots) {
var annt = annots[i];
var props = annt.getProps();
for (var p=0; p<this.numPages; p++) {
if (p==annt.page) continue;
props.page = p;
this.addAnnot(props);
}
}
}
Copy link to clipboard
Copied
Are those stamps the only comments in the file when you run the script?
Copy link to clipboard
Copied
95% of the time yes
Copy link to clipboard
Copied
That's not enough to create a reliable script. I would suggest you use this code, but then it means you have to first select the stamp(s) (or any other comments for that matter) before running it:
this.syncAnnotScan();
var annots = this.selectedAnnots;
if (annots!=null) {
for (var i in annots) {
var annt = annots[i];
var props = annt.getProps();
for (var p=0; p<this.numPages; p++) {
if (p==annt.page) continue;
props.page = p;
this.addAnnot(props);
}
}
}
Copy link to clipboard
Copied
Absolute Legend exactly what i needed thank you!!