Hello, can someone tell me how to extract the page number using a fieldIterator cycle?
Please note that a Field is not part of a page, only their Widgets, the Annotation type that is the visual representation of field is. A Field can be represented by multiple Widgets, and these Widgets can be on multiple pages.
Also, some fields are not required to be part of any page, such as a Digital Signature.
While FieldIterator does provide access to the Widget, and therefor the page number, this mapping is from Widget to Page object, and these are often incorrect, or missing.
The most reliable way to find out what page a Widget is on, is by starting with the PageIterator, and relying on the PageIterator for the page number.
For the code to parse the Widgets from a PageIterator, see our Annotations sample.