Class PdfLoadedChoiceField
- Namespace
- Syncfusion.Pdf.Parsing
- Assembly
- Syncfusion.Pdf.Portable.dll
Represents a choice field of an existing PDF document.
public class PdfLoadedChoiceField : PdfLoadedStyledField, INotifyPropertyChanged
- Inheritance
-
PdfLoadedChoiceField
- Implements
- Derived
- Inherited Members
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
public PdfColor BackColor { get; set; }
Property Value
- See Also
ForeColor
Gets or sets the fore color of the field.
public PdfColor ForeColor { get; set; }
Property Value
- See Also
SelectedIndex
Gets or sets the first selected item in the list.
public int[] SelectedIndex { get; set; }
Property Value
- int[]
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]
public PdfLoadedListItemCollection SelectedItem { get; }
Property Value
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.
public string[] SelectedValue { get; set; }
Property Value
- 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]
public PdfLoadedListItemCollection Values { get; }
Property Value
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
Methods
AssignSelectedIndex(int[])
Sets selected index.
protected void AssignSelectedIndex(int[] value)
Parameters
value
int[]Selected index.
- See Also
AssignSelectedValue(string[])
Sets selected value.
protected void AssignSelectedValue(string[] values)
Parameters
values
string[]
- See Also
ObtainSelectedIndex()
Gets selected index.
protected int[] ObtainSelectedIndex()
Returns
- int[]
Selected index.
- See Also
ObtainSelectedValue()
Gets selected value.
protected string[] ObtainSelectedValue()
Returns
- string[]
Selected value.
- See Also