Hi,
I have a question.
I wont to add ListBoxField to pdf page.
I try it like this code.
Document document = new Document();
Page page = document.getPages().add();
TextFragment textFragment = new TextFragment( “Problem with ListBoxField” );
page.getParagraphs().add( textFragment );
// Options in this list are not displayed!
Rectangle rec1 = new Rectangle( 0, 0, 0, 0 );
ListBoxField listBoxField1 = new ListBoxField(page, rec1);
listBoxField1.setWidth(200);
listBoxField1.setHeight(500);
listBoxField1.setMultiSelect( true );
java.util.Arrays.asList(“First list”,“111”,“221”,“331”,“441”,“551”,“661”,“771”,“881”,“99”,“00”).stream().forEach(listBoxField1::addOption);
//page.getParagraphs().add(listBoxField1);
document.getForm().add(listBoxField1, page.getNumber());
try (OutputStream output = new FileOutputStream(“C:\1\ListBoxField_problem_demo.pdf”)) {
document.save(output);
}
question is - how i can put this field after TextFragment and define size.
like on my screenshot.
Thank you!
Aspose.pdf 17.2.0