Changing the .rotation of all widgets of a form text field in a multipage document
I used the elegant script at https://community.adobe.com/t5/acrobat-discussions/script-that-applies-f-setaction-to-text-fields-with-specific-names-using-some-type-of-wildcard/m-p/15452287#M516095 to successfully rotate my form text fields 90°, but I must be missing something about how to iterate this over all of the pages in the document. It is only acting on the first page of the document. Do I need to push the widgets for each field to an array? Is there a way to use javascript to "duplicate the fields across pages" as in the right-click field menu? Thank you for any advice.
var pRot = this.getPageRotation();
for (var i=0; i<this.numFields; i++) {
var f = this.getField(this.getNthFieldName(i));
if (f==null) continue;
if (f.type=="text") {
f.rotation = pRot + 90;
}
}
I also tried this -
for (var p=0; p<this.numPages; p++) {
var pRot = this.getPageRotation(p);
for (var i=0; i<this.numFields; i++) {
var f = this.getField(this.getNthFieldName(i));
if (f==null) continue;
if (f.type=="text") {
f.rotation = pRot + 90;
}
}
}
