Tuesday, February 14, 2012

iTextSharp and font size of fields.

Acro Fields are easy way to create pdf template and while working with it i need a some way to increase font size of the fields.

AcroFields fields = stamper.AcroFields;
bool set = fields.SetFieldProperty("Name", "textsize", 54.0f, null);
fields.SetField("Name", string.Format("{0} {1}",item.FirstName,item.LastName));

54.0f is size in pixels. you will have to set property before setting a value in the field.