Hi,
I'm trying to fill a PDF form with PDFsharp and there is no problems for fields like PdfTextField or PdfCheckBoxField.
But i encounter two problems with the ComboBoxField :
- I don't understand how to modify (add, delete or modify) the list of the values available for the combo field.
- Setting the value doesn't seem to works (My example code is right below)
Code:
// Open the file
PdfDocument pdf = PdfReader.Open(pdfFilePath);
PdfComboBoxField comboBoxField = (PdfComboBoxField)(pdf.AcroForm.Fields["FRM_CRM1_Marque"]);
if (comboBoxField != null)
{
comboBoxField.Value = new PdfString("Choice 1");
}
// Save the document...
pdf.Save(pdfFillFilePath);
pdf.Close();
Do you know if it is possible to solve my two problems and how please?