Add items to ComboBox field in PDF document using C# with Aspose.PDF for .NET

I have an Acroform format PDF Form created in Acrobat 9.0

It has several drop down list fields some of which I need to populate with some list items. I need to add a selected value AND a text value. Example: “1”, “Name” where “1” represents an id that is returned when the field is read and “Name” is the text that should be displayed in the drop down list to the user of the form.

It seams I can only add a single value using FormEditor.AddListItem(“FieldName”, “Name”);

is there no way to do something like:

ListItem item = new ListItem(“id”, “Name”);
FormEditor.AddListItem(“FieldName”, item);

?

Thanks.

Aha ok I get it now:

string[] listItem = new string[]{“1”, “Name”};

FormEditor.AddListItem(“FieldName”, listItem);

Hi Paul,

Thank you very much for considering Aspose.

I think your issue is resolved. If you find any further issues please do let us know.

Regards,