How do I get sizes and positions for PDF form fields?

Q: We need to get the size and position of the interactive fields on
the form.
I looked at your test project InteractiveFormsTest (http:// 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

For example of how to iterate over widget annotations you may want to
take a look at Annotation sample project (

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();