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

Free Support Forum - aspose.com

Increase the width of form fields

Hi,


Is it possible to increase the width of form fields (text boxes) inside pdf document?

For example, if we have a form field that was placed inside table cell element, we want to set the width of form field to the width of parent cell element

Hi there,


Thanks for your inquiry. I’m working over your query and will update you soon.

Best Regards,

Hi there,


Thanks for your patience. You can modify the position of an existing field. Please refer to following code snippet for the purpose. First you have to get the field. Then use Rect property to getting and setting field position. A Rectangle object with new coordinates is assigned to Rect property for new position.

//open document
Document pdfDocument = new Document(“input.pdf”);
//get a field
TextBoxField textBoxField = pdfDocument.Form[“textbox1”] as TextBoxField;

// get existing position
Aspose.Pdf.Rectangle rect1 = textBoxField.Rect;
//modify field location
textBoxField.Rect = new Aspose.Pdf.Rectangle(rect1.LLX, rect1.LLY, rect1.URX + 50, rect1.URY);
//modify field location
//save modified document
pdfDocument.Save(“output.pdf”);

Best Regards,

Hi,


Thank you for response. In meantime I did some research and got the same conclusion.

Marko

Hi Marko,


Thanks for your feed back. Its good to know that you have managed to get your desired results.

Please feel free to contact us for any further assistance.

Best Regards,