- Home
- Forum
- ASP.NET Core - EJ 2
- filling pdf form fields changes font size
filling pdf form fields changes font size
started playing with filling out an existing pdf form
at first i had 2 issues. some of the fields had their border style removed and also the font size was incorrect after filling it but only some fields.
after using the latest syncfusion version the border style issue is fixed but the font size still changes sometimes
attaching an image that shows a comparison of manually filling the form and the form filled by code
Code used to fill the form is something like this
int index = 0; foreach (var formfield in loadedForm.Fields) { index++; var ftype = formfield.GetType(); var cname = ftype.Name; var basefield = formfield as PdfLoadedStyledField; if (basefield != null) { switch (cname) { case "PdfLoadedTextBoxField": //if (index <= 2) //{ PdfLoadedTextBoxField loadedTextBoxField = formfield as PdfLoadedTextBoxField; if (loadedTextBoxField != null) { loadedTextBoxField.Text = "123"; } //} break; case "PdfLoadedCheckBoxField": break; case "PdfLoadedSignatureField": break; case "PdfLoadedRadioButtonListField": PdfLoadedRadioButtonListField loadedRadioButtonListField = formfield as PdfLoadedRadioButtonListField; loadedRadioButtonListField.SelectedIndex = 0; break; default: // info.ErrorsFound = true; //info.ErrorMessage = $"Field Type Unknown ({cname})"; //return ; break; } } else { throw new Exception("field unknown"); }
Attachment: sfform_39725257.png
Hi Michael Salzlechner,
Upon further analysis, we found that some of the textbox fields in the PDF are configured as auto‑resize fields, while some fields do not have an explicit font defined at the primitive level. Due to this difference in configuration, variations in font size are visible across the textbox fields.
To maintain consistent font size across all textbox fields, we recommend enabling the auto‑resize option uniformly for all fields. When auto‑resize is applied consistently, the font size will be adjusted in a uniform manner for all fields.
You can enable this using the following property:
loadedTextBoxField.AutoResizeText = true;
By applying this setting, the appearance of the textbox fields will be more consistent. Please feel free to verify this at your end, and let us know if you need any further assistance.
Regards,
Jeyalakshmi T
- 2 Replies
- 2 Participants
-
MS Michael Salzlechner
- Apr 18, 2026 09:49 AM UTC
- Apr 20, 2026 01:11 PM UTC