I want to get the page number of a PDAcroFormField (where it is to be found).
Is there a function in jPod that will tell me what the page number of a PDAcroFormField is?
Counterintuitively this is not a trivial task - and as such there's no simple "function".
An acro form field is a logical construct that gets mapped to a page via its annotations. So, what you're looking for is the pag of the annotation. A field may have many annotations (repeating field on any page), so the best bet is to take any one of them (getAnyAnnotation). With the annotation, you could "getPage" - but this is not a mandatory field in the spec. Don't be surprised to get "null" here with documents in the wild. To get around this there's a method "PDAnnotationTools.getPage()", scanning the inverse association from each and every page…
Ok, then, having the page you can ask for "PDPage.getNodeIndex", recursively climbing the page tree and computing the 0 based index.
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.