Table of Contents

Class PdfLoadedXfaComboBoxField

Namespace
Syncfusion.Pdf.Xfa
Assembly
Syncfusion.Pdf.Portable.dll

Represents the existing combo box fields of the XFA form.

public class PdfLoadedXfaComboBoxField : PdfLoadedXfaStyledField
Inheritance
PdfLoadedXfaComboBoxField
Inherited Members

Examples

//Load the existing PDF document
PdfLoadedXfaDocument loadedDocument = new PdfLoadedXfaDocument("input.pdf");
//Load the existing XFA form
PdfLoadedXfaForm loadedForm = loadedDocument.XfaForm;
//Get the loaded combo box field.
PdfLoadedXfaComboBoxField loadedComboBoxField = (loadedForm.Fields["subform1[0]"] as PdfLoadedXfaForm).Fields["comboBoxField[0]"] as PdfLoadedXfaComboBoxField;
//Set the combo box selected index
loadedComboBoxField.SelectedIndex = 1;
//Save the document
loadedDocument.Save("output.pdf");
//Close the document
loadedDocument.Close();
'Load the existing PDF document
Dim loadedDocument As New PdfLoadedXfaDocument("input.pdf")
'Load the existing XFA form
Dim loadedForm As PdfLoadedXfaForm = loadedDocument.XfaForm
'Get the loaded combo box field.
Dim loadedComboBoxField As PdfLoadedXfaComboBoxField = TryCast((TryCast(loadedForm.Fields("subform1[0]"), PdfLoadedXfaForm)).Fields("comboBoxField[0]"), PdfLoadedXfaComboBoxField)
'Set the combo box selected index
loadedComboBoxField.SelectedIndex = 1
'Save the document 
loadedDocument.Save("output.pdf")
'Close the document
loadedDocument.Close()

Constructors

PdfLoadedXfaComboBoxField()

public PdfLoadedXfaComboBoxField()

Properties

HiddenItems

Get the hidden items of combo box field.

public List<string> HiddenItems { get; }

Property Value

List<string>

Items

Gets or sets the items of the combo box field

public List<string> Items { get; set; }

Property Value

List<string>

Examples

//Load the existing PDF document
PdfLoadedXfaDocument loadedDocument = new PdfLoadedXfaDocument("input.pdf");
//Load the existing XFA form
PdfLoadedXfaForm loadedForm = loadedDocument.XfaForm;
//Get the loaded combo box field.
PdfLoadedXfaComboBoxField loadedComboBoxField = (loadedForm.Fields["subform1[0]"] as PdfLoadedXfaForm).Fields["comboBoxField[0]"] as PdfLoadedXfaComboBoxField;
//Get the combo box items.
List<string> items = loadedComboBoxField.Items;
//Set the combo box selected index
loadedComboBoxField.SelectedIndex = 1;
//Save the document
loadedDocument.Save("output.pdf");
//Close the document
loadedDocument.Close();
'Load the existing PDF document
Dim loadedDocument As New PdfLoadedXfaDocument("input.pdf")
'Load the existing XFA form
Dim loadedForm As PdfLoadedXfaForm = loadedDocument.XfaForm
'Get the loaded combo box field.
Dim loadedComboBoxField As PdfLoadedXfaComboBoxField = TryCast((TryCast(loadedForm.Fields("subform1[0]"), PdfLoadedXfaForm)).Fields("comboBoxField[0]"), PdfLoadedXfaComboBoxField)
'Get the combo box items.
Dim items As List(Of String) = loadedComboBoxField.Items
'Set the combo box selected index
loadedComboBoxField.SelectedIndex = 1
'Save the document 
loadedDocument.Save("output.pdf")
'Close the document
loadedDocument.Close()

SelectedIndex

Gets or sets the default index of the combo box field

public int SelectedIndex { get; set; }

Property Value

int

Examples

//Load the existing PDF document
PdfLoadedXfaDocument loadedDocument = new PdfLoadedXfaDocument("input.pdf");
//Load the existing XFA form
PdfLoadedXfaForm loadedForm = loadedDocument.XfaForm;
//Get the loaded combo box field.
PdfLoadedXfaComboBoxField loadedComboBoxField = (loadedForm.Fields["subform1[0]"] as PdfLoadedXfaForm).Fields["comboBoxField[0]"] as PdfLoadedXfaComboBoxField;
//Set the combo box selected index
loadedComboBoxField.SelectedIndex = 1;
//Save the document
loadedDocument.Save("output.pdf");
//Close the document
loadedDocument.Close();
'Load the existing PDF document
Dim loadedDocument As New PdfLoadedXfaDocument("input.pdf")
'Load the existing XFA form
Dim loadedForm As PdfLoadedXfaForm = loadedDocument.XfaForm
'Get the loaded combo box field.
Dim loadedComboBoxField As PdfLoadedXfaComboBoxField = TryCast((TryCast(loadedForm.Fields("subform1[0]"), PdfLoadedXfaForm)).Fields("comboBoxField[0]"), PdfLoadedXfaComboBoxField)
'Set the combo box selected index
loadedComboBoxField.SelectedIndex = 1
'Save the document 
loadedDocument.Save("output.pdf")
'Close the document
loadedDocument.Close()

SelectedValue

Gets or Sets the default value of the combo box field

public string SelectedValue { get; set; }

Property Value

string

Examples

//Load the existing PDF document
PdfLoadedXfaDocument loadedDocument = new PdfLoadedXfaDocument("input.pdf");
//Load the existing XFA form
PdfLoadedXfaForm loadedForm = loadedDocument.XfaForm;
//Get the loaded combo box field.
PdfLoadedXfaComboBoxField loadedComboBoxField = (loadedForm.Fields["subform1[0]"] as PdfLoadedXfaForm).Fields["comboBoxField[0]"] as PdfLoadedXfaComboBoxField;
//Set the combo box selected value
loadedComboBoxField.SelectedValue = "English";
//Save the document
loadedDocument.Save("output.pdf");
//Close the document
loadedDocument.Close();
'Load the existing PDF document
Dim loadedDocument As New PdfLoadedXfaDocument("input.pdf")
'Load the existing XFA form
Dim loadedForm As PdfLoadedXfaForm = loadedDocument.XfaForm
'Get the loaded combo box field.
Dim loadedComboBoxField As PdfLoadedXfaComboBoxField = TryCast((TryCast(loadedForm.Fields("subform1[0]"), PdfLoadedXfaForm)).Fields("comboBoxField[0]"), PdfLoadedXfaComboBoxField)
'Set the combo box selected value
loadedComboBoxField.SelectedValue = "English"
'Save the document 
loadedDocument.Save("output.pdf")
'Close the document
loadedDocument.Close()