Alternative to AcroFields.Item.widgets?

View: New views
1 Messages — Rating Filter:   Alert me  

Alternative to AcroFields.Item.widgets?

by wbustraan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I just updated my code to iText 2.1.5 and noticed that 'AcroFields.Item.widgets' is marked as deprecated.

I have a for loop that loops through all the widgets like so:

for (Iterator<?> i=widgets.iterator(); i.hasNext(); ) {
   dict = (PdfDictionary)i.next();
}

Once the widgets field is no longer public my code will break, so I'm looking for an alternative.

I see there is a AcroFields.Item.getWidget(int idx) method, but how would I get the length of the widget array to make ensure that the index is in bounds?