Showing posts with label iTextSharp. Show all posts
Showing posts with label iTextSharp. Show all posts

Wednesday, November 30, 2011

iTextSharp AcroField Font Size

While working with iTextSharp to fill AcroFields in a PDF, I noticed the font size of the text fields were a little larger than I wanted.

I found this great post that helped me out http://www.keithnordstrom.com/?tag=/itextsharp

which boils down to this:

AcroFields fields = stamper.AcroFields;
bool set = fields.SetFieldProperty(fieldName, "textsize", 12.0f, null);

The only thing to note is that you must set the form field size before putting text into the field otherwise it won't work...