Carlos Alejo
Carlos Alejo

Reputation: 11

Itext 7 .net: filling PdfChoiceFormField

I used itext5 and to fill in the values of a combo (Acroform) I used this code:

 formfields.SetListOption(combo, values, descriptions);

Now with Itext7 I'm a little bit lost, I have this: (formfields is an PdfAcroForm)

 formfields.GetField(combo)

but I can't found how to fill the combo values.

Any clues?, Thank you

Upvotes: 0

Views: 300

Answers (1)

Carlos Alejo
Carlos Alejo

Reputation: 11

Ok, I found a way to do it:

List<string> iValues = new List<string>();
// fill iValues 
PdfArray valuesArray = new PdfArray(iValores,true);
formfields.GetField(combo).SetOptions(valuesArray);

and it works.

Upvotes: 1

Related Questions