I am creating secure digital signature fields with random number names with similar prefixes. The idea is to have multiple fields available in a single regular PDF (non portfolio). So on each sheet we sign 3 fields. One field is a name, another is a date and the last is a release. This goes on every sheet and the PDF would contain up to 1500 pages. Adding a random number to the end of each field name was the only way to make this work....now I have a problem of finding the particular fields for my script to sign the sheets.
I am guessing that there must be some way to identify how many fields I have on a sheet and return the name of all the fields. If I can get the name of all the fields I can use that info to run my script to place the digital signature appearances in their correct field. My field names all begin with either 'Date', 'Sig' or 'RFC' followed by a random number to avoid duplicate fields.
Are you able to add another prefix, specifically using hierarchical field names that include the page number? For example, on page one the fields could be named:
P1.Date[random number goes here]
P1.Sig[random number goes here]
P1.RFC[random number goes here]
You can then get all of the P1 fields like this:
var fields = getField("P1");
and then use the getArray method to get an array of the individual field references and iterate through the array.
Otherwise, you can loop through the fields and look at the page property of each to determine which ones are on which pages. You can use the getNthFieldName document method and numFields document property to do this.