Q: We need to get the size and position of the interactive fields on
the form.
I looked at your test project InteractiveFormsTest (http://
www.pdftron.com/net/samplecode.html#InteractiveForms). I see how to
iterate through the fields and get the field names and types. Can I
use your software to also get the field sizes and positions some how?
------
A: A form filed in PDF can have multiple visual representations on
pages. These visual representations are called widget annotations. You
can obtain 'pdftron.PDF.Field' from an instance of a Widget
annotation.
For example of how to iterate over widget annotations you may want to
take a look at Annotation sample project (http://www.pdftron.com/net/
samplecode.html#Annotation).
For example:
PageIterator itr = doc.GetPageIterator(); for (; itr.HasNext();
itr.Next()) {
Page page = itr.Current();
int num_annots = page.GetNumAnnots();
for (int i=0; i<num_annots; ++i) {
Annot annot = page.GetAnnot(i);
if (annot.IsValid() == false) continue;
if (annot.GetType() == Annot.Type.e_Widget) {
Rect bbox = annot.GetRect();
Field field = annot.GetWidgetField();
...
}
}