Table of Contents

Class PdfLoadedComboBoxField

Namespace
Syncfusion.Pdf.Parsing
Assembly
Syncfusion.Pdf.Portable.dll

Represents the combo box field of an existing item.

public class PdfLoadedComboBoxField : PdfLoadedChoiceField, INotifyPropertyChanged
Inheritance
PdfLoadedComboBoxField
Implements
Inherited Members

Examples

//Load an existing document.
PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");
// Read a combo box field
PdfLoadedComboBoxField comboField = doc.Form.Fields["EmployeeCombo"] as PdfLoadedComboBoxField;
comboField.SelectedIndex = 0;
doc.Save("Form.pdf");
doc.Close(true);
'Load an existing document
Dim doc As PdfLoadedDocument = New PdfLoadedDocument("SourceForm.pdf")
'Read a combo box field
Dim comboField As PdfLoadedComboBoxField = TryCast(doc.Form.Fields("EmployeeCombo"), PdfLoadedComboBoxField)
comboField.SelectedIndex = 0
doc.Save("Form.pdf")
doc.Close(True)

Properties

ComplexScript

Gets or sets the complex script language support.

public bool ComplexScript { get; set; }

Property Value

bool

Examples

//Load existing PDF document.
PdfLoadedDocument ldoc = new PdfLoadedDocument("form.pdf");
//Load the existing combo box field.
PdfLoadedComboBoxField combo = lfied as PdfLoadedComboBoxField;
//Create font.
Font font = new Font("Tahoma", 10f);
//Create a new PDF font instance.
PdfFont pdfFont = new PdfTrueTypeFont(font, FontStyle.Regular, 10f, true, true);
//Set font.
combo.Font = pdfFont;
//Enable complex script support.
combo.ComplexScript = true;
ldoc.Form.SetDefaultAppearance(false);
//Save the document.
ldoc.Save("output.pdf");
//Close the document.
ldoc.Close(true);
'Load existing PDF document.
Dim ldoc As New PdfLoadedDocument("form.pdf")
'Load the existing combo box field.
Dim combo As PdfLoadedComboBoxField = TryCast(ldoc.Form.Fields(0), PdfLoadedComboBoxField)
'Create font.
Dim font As New Font("Tahoma", 10F)
'Create a new PDF font instance.
Dim pdfFont As PdfFont = New PdfTrueTypeFont(font, FontStyle.Regular, 10F, True, True)
'Set font.
combo.Font = pdfFont
'Enable complex script support.
combo.ComplexScript = True
ldoc.Form.SetDefaultAppearance(False)
'Save the document.
ldoc.Save("output.pdf")
'Close the document.
ldoc.Close(True)
See Also

Editable

Gets or sets a value indicating whether this PdfComboBoxField is editable.

public bool Editable { get; set; }

Property Value

bool

True if the drop down list is editable, false otherwise. Default is false.

Examples

//Load an existing document.
PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");
// Load an existing combo field
PdfLoadedComboBoxField comboField = doc.Form.Fields["EmployeeCombo"] as PdfLoadedComboBoxField;
comboField.Editable = false;
doc.Save("Form.pdf");
doc.Close(true);
'Load an existing document
Dim doc As PdfLoadedDocument = New PdfLoadedDocument("SourceForm.pdf")
'Load an existing Check field
Dim comboField As PdfLoadedComboBoxField = TryCast(doc.Form.Fields("EmployeeCombo"), PdfLoadedComboBoxField)
comboField.Editable = False    
doc.Save("Form.pdf")
doc.Close(True)
See Also

Items

Gets the collection of combo box items.[Read-Only]

public PdfLoadedComboBoxItemCollection Items { get; }

Property Value

PdfLoadedComboBoxItemCollection

Examples

//Load an existing document.
PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");           
// Load an existing combo field
PdfLoadedComboBoxField comboField = doc.Form.Fields["EmployeeCombo"] as PdfLoadedComboBoxField;
// Load combo field collection
PdfLoadedComboBoxItemCollection comboCollection = comboField.Items;
// Reading first item of the collection.
PdfLoadedComboBoxItem item = comboCollection[0];
item.Location = new PointF(200, 200);
doc.Save("Form.pdf");
doc.Close(true);
'Load an existing document.
Dim doc As PdfLoadedDocument = New PdfLoadedDocument("SourceForm.pdf")
'Load an existing combo field
Dim comboField As PdfLoadedComboBoxField = TryCast(doc.Form.Fields("EmployeeCombo"), PdfLoadedComboBoxField)
'Load combo field collection
Dim comboCollection As PdfLoadedComboBoxItemCollection = comboField.Items
'Reading first item of the collection.
Dim item As PdfLoadedComboBoxItem = comboCollection(0)
item.Location = New PointF(200, 200)
doc.Save("Form.pdf")
doc.Close(True)
See Also

SelectedIndex

Gets or sets the index which is to be selected.

public int SelectedIndex { get; set; }

Property Value

int

Examples

//Load an existing document.
PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");
// Read a combo box field
PdfLoadedComboBoxField comboField = doc.Form.Fields["EmployeeCombo"] as PdfLoadedComboBoxField;
comboField.SelectedIndex = 0;
doc.Save("Form.pdf");
doc.Close(true);
'Load an existing document
Dim doc As PdfLoadedDocument = New PdfLoadedDocument("SourceForm.pdf")
'Read a combo box field
Dim comboField As PdfLoadedComboBoxField = TryCast(doc.Form.Fields("EmployeeCombo"), PdfLoadedComboBoxField)
comboField.SelectedIndex = 0
doc.Save("Form.pdf")
doc.Close(True)
See Also

SelectedValue

Gets or sets the value which is to be selected.

public string SelectedValue { get; set; }

Property Value

string

Examples

//Load an existing document.
PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");
// Read a combo box field
PdfLoadedComboBoxField comboField = doc.Form.Fields["EmployeeCombo"] as PdfLoadedComboBoxField;
comboField.SelectedValue = "Employee";
doc.Save("Form.pdf");
doc.Close(true);
'Load an existing document
Dim doc As PdfLoadedDocument = New PdfLoadedDocument("SourceForm.pdf")
'Read a combo box field
Dim comboField As PdfLoadedComboBoxField = TryCast(doc.Form.Fields("EmployeeCombo"), PdfLoadedComboBoxField)
comboField.SelectedValue = "Employee"
doc.Save("Form.pdf")
doc.Close(True)
See Also

Methods

Remove(PdfLoadedComboBoxItem)

Remove the particular PdfLoadedComboBoxItem from PdfLoadedComboBoxField.

public void Remove(PdfLoadedComboBoxItem item)

Parameters

item PdfLoadedComboBoxItem

Examples

 //Load an existing document
 PdfLoadedDocument loadedDocument = new PdfLoadedDocument("input.pdf");       
 //Get the loaded form.
  PdfLoadedForm loadedForm = loadedDocument.Form;
 //Get the comboBoxField
 PdfLoadedComboBoxField comboBoxField = loadedForm.Fields[0] as PdfLoadedComboBoxField;
 //Get the comboBoxfield item
 PdfLoadedComboBoxItem comboBoxFieldItem = comboBoxField.Items[0] as PdfLoadedComboBoxItem;
//Remove the ComboBoxItem
 loadedField.Remove(comboBoxFieldItem); 
 //Save the modified document.
 loadedDocument.Save("form.pdf");
//Close the document
loadedDocument.Close(true);
See Also

RemoveAt(int)

Remove the PdfLoadedComboBoxField item at the specified index.

public void RemoveAt(int index)

Parameters

index int

Examples

 //Load an existing document
 PdfLoadedDocument loadedDocument = new PdfLoadedDocument("input.pdf");        
 //Get the loaded form.
  PdfLoadedForm loadedForm = loadedDocument.Form;
 //Get the comboBoxField 
 PdfLoadedComboBoxField comboBoxField = loadedForm.Fields[0] as PdfLoadedComboBoxField;       
//Remove the comboBoxField item
 comboBoxField.RemoveAt(0);
//Save the modified document.
 loadedDocument.Save("form.pdf");
//Close the document
loadedDocument.Close(true);
See Also

See Also