Class PdfLoadedChoiceField
Represents a choice field of an existing PDF document.
Inheritance
System.Object
PdfLoadedChoiceField
Implements
System.ComponentModel.INotifyPropertyChanged
Inherited Members
Namespace: Syncfusion.Pdf.Parsing
Assembly: Syncfusion.Pdf.Base.dll
Syntax
public class PdfLoadedChoiceField : PdfLoadedStyledField, IPdfWrapper, INotifyPropertyChanged
Examples
//Load an existing document
PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");
// Load an existing choice field
PdfLoadedChoiceField choiceField = doc.Form.Fields["Java"] as PdfLoadedChoiceField;
choiceField.SelectedIndex = 0;
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 choiceField As PdfLoadedChoiceField = TryCast(doc.Form.Fields("Java"), PdfLoadedChoiceField)
choiceField.SelectedIndex = 0
doc.Save("Form.pdf")
doc.Close(True)
Properties
BackColor
Get or sets the back color of the field
Declaration
public PdfColor BackColor { get; set; }
Property Value
Type |
---|
PdfColor |
ForeColor
Gets or sets the fore color of the field.
Declaration
public PdfColor ForeColor { get; set; }
Property Value
Type |
---|
PdfColor |
SelectedIndex
Gets or sets the first selected item in the list.
Declaration
public int[] SelectedIndex { get; set; }
Property Value
Type |
---|
System.Int32[] |
Examples
//Load an existing document
PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");
// Load an existing choice field
PdfLoadedChoiceField choiceField = doc.Form.Fields["Java"] as PdfLoadedChoiceField;
choiceField.SelectedIndex = new int[] { 0 };
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 choiceField As PdfLoadedChoiceField = TryCast(doc.Form.Fields("Java"), PdfLoadedChoiceField)
choiceField.SelectedIndex = New Integer() {0}
doc.Save("Form.pdf")
doc.Close(True)
See Also
SelectedItem
Gets the selected items in the list.[Read-Only]
Declaration
public PdfLoadedListItemCollection SelectedItem { get; }
Property Value
Type |
---|
PdfLoadedListItemCollection |
Examples
//Load an existing document
PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");
// Load an existing Check field
PdfLoadedChoiceField choiceField = doc.Form.Fields["Java"] as PdfLoadedChoiceField;
// Change the selected item
PdfLoadedListItemCollection items = choiceField.SelectedItem;
items[0].Text = "New Text";
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 choiceField As PdfLoadedChoiceField = TryCast(doc.Form.Fields("Java"), PdfLoadedChoiceField)
' Change the selected item
Dim items As PdfLoadedListItemCollection = choiceField.SelectedItem
items(0).Text = "New Text"
doc.Save("Form.pdf")
doc.Close(True)
See Also
SelectedValue
Gets or sets the value of the first selected item in the list.
Declaration
public string[] SelectedValue { get; set; }
Property Value
Type |
---|
System.String[] |
Examples
//Load an existing document
PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");
// Load an existing choice field
PdfLoadedChoiceField choiceField = doc.Form.Fields["Java"] as PdfLoadedChoiceField;
choiceField.SelectedValue = new string[] { "Employee" };
doc.Save("Form.pdf");
doc.Close(true);
'Load an existing document
Dim doc As PdfLoadedDocument = New PdfLoadedDocument("SourceForm.pdf")
' Load an existing choice field
Dim choiceField As PdfLoadedChoiceField = TryCast(doc.Form.Fields("Java"), PdfLoadedChoiceField)
choiceField.SelectedValue = New String() { "Employee" }
doc.Save("Form.pdf")
doc.Close(True)
See Also
Values
Gets the collection of choice items.[Read-Only]
Declaration
public PdfLoadedListItemCollection Values { get; }
Property Value
Type |
---|
PdfLoadedListItemCollection |
Examples
//Load an existing document
PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");
// Load an existing Check field
PdfLoadedChoiceField choiceField = doc.Form.Fields["Java"] as PdfLoadedChoiceField;
// Change the selected item
PdfLoadedListItemCollection items = choiceField.SelectedItem;
items[0].Text = "New Text";
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 choiceField As PdfLoadedChoiceField = TryCast(doc.Form.Fields("Java"), PdfLoadedChoiceField)
' Change the selected item
Dim items As PdfLoadedListItemCollection = choiceField.SelectedItem
items(0).Text = "New Text"
doc.Save("Form.pdf")
doc.Close(True)
Methods
AssignSelectedIndex(Int32[])
Sets selected index.
Declaration
protected void AssignSelectedIndex(int[] value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32[] | value | Selected index. |
AssignSelectedValue(String[])
Sets selected value.
Declaration
protected void AssignSelectedValue(string[] values)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | values |
ObtainSelectedIndex()
Gets selected index.
Declaration
protected int[] ObtainSelectedIndex()
Returns
Type | Description |
---|---|
System.Int32[] | Selected index. |
ObtainSelectedValue()
Gets selected value.
Declaration
protected string[] ObtainSelectedValue()
Returns
Type | Description |
---|---|
System.String[] | Selected value. |
Implements
System.ComponentModel.INotifyPropertyChanged