How do I resize a form field?

Q: I am working with fields on a PDF through C#. I need to have a
field on the PDF that can change in size depending on how many lines
of text I send it. It also needs to resize the rest of the document
along with it.
Is this possible?
A: You can change the dimensions of a form filed using Annot.SetRect()
For example, given a field you can initialize corresponding widget
annotation and modify its position and dimensions as follows:
Annot widget = new Annot(field.GetSDFObj()); Rect rect =
widget.GetRect(); rect.Normalize();

// Modify the widget rectangle
// by increasing the height of a field
rect.y1 = rect.y1 - 50; // PDF uses units called points. 1pt = 1/72

field.SetValue("New Value");