Copy link to clipboard
Copied
I created an Action that creates a text field on the top of the page. How do I get it to repeat it on the top of the remainder of the pages in the document?
// Create the "DatePrinted" field on the top of the first page
var fldTop = this.addField("DatePrinted", "text", 0, [36,774,576,756]);
fldTop.value = "DatePrinted";
fldTop.textSize = 14;
fldTop.textfont = font.Arial;
fldTop.textColor = color.red;
fldTop.alignment = "center";
fldTop.display = display.hidden;
fldTop.readonly= true;
fldTop.doNotSpellCheck = true;
fldTop.doNotScroll = true;
Any assistance will be greatly appreciated,
Thanks
You need to place your code inside a loop from 0 to this.numPages, changing the third parameter of the addField method to the page number in each iteration.
Copy link to clipboard
Copied
You need to place your code inside a loop from 0 to this.numPages, changing the third parameter of the addField method to the page number in each iteration.
Copy link to clipboard
Copied
That's what I originally thought, but was thinking there had to be a magic way to get er' done. It will work, and Thanks!
Copy link to clipboard
Copied
No "magical" way to do it, no...
Copy link to clipboard
Copied
My solution for any interested parties... Not elegant, but it works
for (var pg = 0; pg < this.numPages; pg++) {
// Place text field on the top of the page
var f = this.addField("DatePrinted", "text", pg, [36,774,576,756]);
/}
Copy link to clipboard
Copied
Why do you say it's "not elegant"?