Free Support Forum - aspose.com

How to change textbox field size in pdf file

I use Aspose .pdf for .NET to load, retrieve and re-set the value of the textbox field from existing .pdf file. Sometimes, the string lengh of the value is longer than the pre-defined size of the textbox field in pdf file. Is there any way to dynamically modify the lengh of the textbox field in existing .pdf file? I already tried to set maxlength, but it didn't change the textbox size in the file.

Hi Lin,



You may consider using SetFieldLimit(…) method of FormEditor class present under Aspose.Pdf.Facades namespace to accomplish your requirement. In case you still encounter some issue or you have any further query, please feel free to contact. We are sorry for this inconvenience.



[C#]



FormEditor formEditor = new FormEditor(“PdfForm.pdf”, “FormEditor_SetFieldLimit.pdf”);

formEditor.SetFieldLimit(“textField”, 15);