I have a simple loop that iterates through each field in a multi-page PDF. This seems to work fine, but I notice in some cases manages to skip fields that I know are legimitately there. This PDF resides on a webserver, and some fields are actually created dynamically via button clicks, etc. - using a form submit and FDFToolkit "listener" script injection on the server. This all works fine. I thought the nature in which I'm dynamically creating these fields (var f = this.addField...) was the reason why they're not apparent during my loop, but I noticed that when I dynamically create 6 identical text fields for instance - 3 are found in the loop and 3 are not. Seems like it misses every other field. Additionally - regular old form fields on the PDF from the get go are missed - I have 2 similar buttons with different names and the loop only grabs one. So strange! Any help would be greatly appreciated! Here is my basic loop structure FYI:
var fieldName = "";
for (var i = 0; i<this.numFields; i++)
fieldName = this.getNthFieldName(i);
console.println("Found Field: " + fieldName);
Make sure you're not changing the value of i anywhere else inside your loop...
I have a multiversion example in which, as the document becomes more complex, I have to click several times until the click is processed. Simpler versions don't miss a beat.
This seems to be a case of:
(a) Having to migrate our code to SDK-based native code for performance reasons.
I am using the traditional Acroforms.