How do I export form values from PDF using PDFNet?

Q:

It is possible to get the PDF export values using PDFNet?
I am looking for something like this http://forums.adobe.com/message/3415872
but for use in my own app.

A:

To access the value of a combo box (or any other type of widget/form annotation) you would:

  1. Get a reference to the annotation object. (Something similar to http://www.pdftron.com/pdfnet/samplecode/AnnotationTest.cs)

  2. Create a Widget annotation from that object provided the annotation is a widget. (new Widget(annot))

  3. Call GetField on the Widget.

  4. Call GetValue or GetValueAsString on the Field Object.