Posted by a ceTe Software moderator
Hello,
The following sample lines of code will show you how to get the selected value from the ComboBox and filling the ComboBox field.
C# Code:
// To get the selected value
// Take a PdfDocument object of the PDF document
PdfDocument pdfDocument =new PdfDocument(@"C:\Temp\DocumentA.pdf");
// Reading the selected value from the ComboBox
string selectedValue = pdfDocument.Form.Fields["combo"].GetValue();
// To set the value for ComboBox
// Take MergeDocument object in order to fill the combobox
MergeDocument document=new MergeDocument(@"C:\Temp\DocumentA.pdf");
// Set the field value
document.Form.Fields["combo"].Value = "Two";
VB.NET Code:
' To get the selected value
' Take a PdfDocument object of the PDF document
Dim pdfDocument As New PdfDocument("C:\Temp\DocumentA.pdf")
' Reading the selected value from the ComboBox
Dim selectedValue As String = pdfDocument.Form.Fields("combo").GetValue()
' To set the value for ComboBox
' Take MergeDocument object in order to fill the combobox
Dim document As New MergeDocument("C:\Temp\DocumentA.pdf")
' Set the field value
document.Form.Fields("combo").Value = "Two"
You can refer to the
Form Filling topic to know more details on filling the forfields and
Reading Form Field Values topic to know more about reading the form field values.
Thanks,
ceTe Software Support Team.