My program has to do some styling on PDF Acrofields. One of those is to center the text inside a multiline textfield (not a richtext field) horizontally and vertically. I managed to center it horizontally using this code:
var centeredField = stamper.AcroFields.GetFieldItem(field.Name);
centeredField.GetWidget(0).Put(PdfName.Q, new PdfNumber(PdfFormField.Q_CENTER));
But I cannot find any way to center the text vertically. Any help is dearly appreciated.
For textfield I think there's no way to make vertical alignment. Try to understand that in general text alignment in pdf or word documents only have horizontal alignment(left, center, right). (Textfield is not similar to div in html) So you may try with richtext field or in other way.