Retrieve Information about the Font of a TextBoxField

How do I retrieve the font information of a TextBoxField? Such as the font type, font family, font size, and font weight.

Thanks,
Diane Asberry

Hi Diane,


Thanks for your inquiry. You may check following code snippet to get font name and font size of form fields. Hopefully it will help you to accomplish the task.

Document pdf = new
Document(“input.pdf”);<o:p></o:p>

var pdfForm = new Aspose.Pdf.Facades.Form(pdf);

foreach (Field formField in pdf.Form)

{

var fieldFullName = formField.FullName;

var facadeField = pdfForm.GetFieldFacade(fieldFullName);

var fieldType = pdfForm.GetFieldType(fieldFullName);

Console.WriteLine("field FullName: {0},fieldType:{1}, Font :{2}, FontSize: {3}, CustomFont: {4}",

fieldFullName,

fieldType,

facadeField.Font,

facadeField.FontSize,

facadeField.CustomFont);

}

Console.ReadLine();


Please feel free to contact us for any further assistance.


Best Regards,

Hi Diane,


Thanks for your feedback. It is good to know the information worked for you.

Please keep using our API and feel free to ask any question or concern, we will be more than happy to extend our support.

Best Regards,