We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Width FormField

Hi guys,


I try the last version of Aspose Word for my company and one of the requirement is to export an editable PDF.

I found how to provide editable FormField but I don’t know where I can manage the size of each fields.

I would like to fix a specific width for my text field.

Here one sample I have

builder.MoveTo(row.Cells[1].Paragraphs[0]);
var tempField = builder.InsertTextInput(“ActivityName” + i, TextFormFieldType.Regular, “@”, activity.Name, 200);
row.Cells[1].Paragraphs[0].RemoveChild(row.Cells[1].Paragraphs[0].FirstChild);
builder.MoveTo(row.Cells[2].Paragraphs[0]);

In this sample I’d like to hard set the width of “tempField” to 200px.
I use an existing word template and fill some information inside.

Best regards,
Yoann

Hi Yoann,


Thanks for your inquiry. Please note currently Aspose.Words does not support to set form field width. We have logged a ticket WORDSNET-15154 in our issue tracking system for the requirements. We will keep you updated about the issue resolution progress.

Best Regards,

Hi Yoann,


Thanks for your patience. Please note Aspose.Words mimics the same behavior as MS Word does. In MS Words form field size is determined by its content, thus form field cannot have fixed width/height. On the other hand in PDF form fields size is fixed.

However to achieve your requirements you can try any of following workarounds:

1. Fill up the field with spaces to the required size in Word Document.
2. Use third-party PDF editing tool (like Aspose.Pdf) to set up form field size in PDF document. Form field in PDF document could be found by its name.

Please feel free to contact us for any further assistance.

Best Regards,