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

Free Support Forum - aspose.com

Drop Down Form Field

Hi,

I need to extract text from drop down form field, but I don’t really know do You support this and how could I extract text from this form?

Can You please help me and send me how I can do this?
I attached file with drop down form field, from this form I need to get to “First”, “Second” and “Third” text.


Thanks
Best regrds

Hi Djordje,


Thanks for your inquiry. Please use the following code to meet this requirement.
Document doc = new Document(getMyDir() + “DropDownFormField.docx”);
FormField ff = doc.getRange().getFormFields().get(0);
int i = 0;
while (!ff.getResult().equals("")){
System.out.println(ff.getResult());
ff.setDropDownSelectedIndex(++i);
}
I hope, this helps.

Best regards,

Hi,

thanks for answer, but I forgot to tell You that I use DocumentVisitor for visiting end extracting document text, so can You please send me some solution which use DocumentVisitor. Is FormField field node or other, how can I visit him?

Best regards

Hi Djordje,


Thanks for your inquiry. Yes, you can get handle to FormField inside DocumentVisitor.VisitFormField Method and execute the code from my previous post to get individual list items. Hope, this helps.

Best regards,