I'm setting the selected index of a PdfComboBoxField, but when generating the pdf it appears that the selected index value is ignored. Is there an issue with this?
cheers
Steve
- Code: Select all
Spire.Pdf.Fields.PdfComboBoxField cb = new Spire.Pdf.Fields.PdfComboBoxField(page, uniqueFieldName);
cb.Bounds = new RectangleF(searchItem.Position.X, searchItem.Position.Y + offset, size.Width, size.Height);
cb.Font = new Spire.Pdf.Graphics.PdfFont(Spire.Pdf.Graphics.PdfFontFamily.Helvetica, 9f);
cb.Items.Add(new Spire.Pdf.Fields.PdfListFieldItem("A", "A"));
cb.Items.Add(new Spire.Pdf.Fields.PdfListFieldItem("B", "B"));
cb.Items.Add(new Spire.Pdf.Fields.PdfListFieldItem("C", "C"));
cb.SelectedIndex = 1;
document.Form.Fields.Add(cb);