Class PdfLoadedComboBoxField
Represents the combo box field of an existing item.
Inheritance
System.Object
PdfLoadedComboBoxField
Implements
System.ComponentModel.INotifyPropertyChanged
Inherited Members
Namespace: Syncfusion.Pdf.Parsing
Assembly: Syncfusion.Pdf.NET.dll
Syntax
public class PdfLoadedComboBoxField : PdfLoadedChoiceField, IPdfWrapper, INotifyPropertyChanged
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.
Declaration
public bool ComplexScript { get; set; }
Property Value
Type |
---|
System.Boolean |
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)
Editable
Gets or sets a value indicating whether this PdfComboBoxField is editable.
Declaration
public bool Editable { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | 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]
Declaration
public PdfLoadedComboBoxItemCollection Items { get; }
Property Value
Type |
---|
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.
Declaration
public int SelectedIndex { get; set; }
Property Value
Type |
---|
System.Int32 |
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)
SelectedValue
Gets or sets the value which is to be selected.
Declaration
public string SelectedValue { get; set; }
Property Value
Type |
---|
System.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)
Methods
Remove(PdfLoadedComboBoxItem)
Remove the particular PdfLoadedComboBoxItem from PdfLoadedComboBoxField.
Declaration
public void Remove(PdfLoadedComboBoxItem item)
Parameters
Type | Name | Description |
---|---|---|
PdfLoadedComboBoxItem | item |
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);
RemoveAt(Int32)
Remove the PdfLoadedComboBoxField item at the specified index.
Declaration
public void RemoveAt(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index |
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);
Implements
System.ComponentModel.INotifyPropertyChanged