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

Free Support Forum - aspose.com

Border for TextBoxField

When creating a TextBoxField and setting a border, no border shows up after saving the pdf. The TextBoxField is the only object on the pdf. I’m using the sample code snippet from the Aspose site:

Document document = new Document(“c:\temp\plain.pdf”);
Rectangle rectangle = new Rectangle(100, 200, 300, 300);
TextBoxField textBoxField1 = new TextBoxField(document.getPages().get_Item(1),rectangle);
textBoxField1.setPartialName(“textbox1”);
textBoxField1.setValue(“Test Box”);
Border border = new Border(textBoxField1);
border.setWidth(5);
border.setDash(new Dash(1,1));
textBoxField1.setBorder(border);
document.getForm().add(textBoxField1, 1);
document.save(“c:\temp\_output.pdf”);

Hi Gary,


Thanks for your inquiry. Please set border color in TextBox field Characteristics property as following, it will help you to accomplish the task.

…<o:p></o:p>

textBoxField1.getCharacteristics().setBorder(java.awt.Color.BLACK);

textBoxField1.setBorder(border);

....


Please feel free to contact us for any further assistance.

Best Regards,