Class PdfLoadedRadioButtonListField
- Namespace
- Syncfusion.Pdf.Parsing
- Assembly
- Syncfusion.Pdf.Portable.dll
Represents radio button field of an existing PDF document.
public class PdfLoadedRadioButtonListField : PdfLoadedStateField, INotifyPropertyChanged
- Inheritance
-
PdfLoadedRadioButtonListField
- Implements
- Inherited Members
Examples
//Load an existing document
PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");
// Read the 'Gender' radio button field
PdfLoadedRadioButtonListField radiobuttonField = doc.Form.Fields["Gender"] as PdfLoadedRadioButtonListField;
// Flatten the radio button field
radiobuttonField.Flatten = true;
doc.Save("LoadedForm.pdf");
doc.Close(true);
'Load an existing document
Dim doc As PdfLoadedDocument = New PdfLoadedDocument("SourceForm.pdf")
' Read the 'Gender' radio button field
Dim radiobuttonField As PdfLoadedRadioButtonListField = TryCast(doc.Form.Fields("Gender"), PdfLoadedRadioButtonListField)
' Flatten the radio button field
radiobuttonField.Flatten = True
doc.Save("LoadedForm.pdf")
doc.Close(True)
Properties
Items
Gets the collection of radio button items.[Read-Only]
public PdfLoadedRadioButtonItemCollection Items { get; }
Property Value
- PdfLoadedRadioButtonItemCollection
A PdfLoadedRadioButtonItemCollection that represents the items within the list.
Examples
//Load an existing document
PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");
// Getting the 'Gender' radio button field
PdfLoadedRadioButtonListField radiobuttonField = doc.Form.Fields["Gender"] as PdfLoadedRadioButtonListField;
// Radio button field collection
PdfLoadedRadioButtonItemCollection radiobuttonFieldCollection = radiobuttonField.Items;
// Radio button field item
PdfLoadedRadioButtonItem radiobuttonItem = radiobuttonFieldCollection[0];
// Selected the item
radiobuttonItem.Checked = true;
doc.Save("LoadedForm.pdf");
doc.Close(true);
'Load an existing document
Dim doc As PdfLoadedDocument = New PdfLoadedDocument("SourceForm.pdf")
' Getting the 'Gender' radio button field
Dim radiobuttonField As PdfLoadedRadioButtonListField = TryCast(doc.Form.Fields("Gender"), PdfLoadedRadioButtonListField)
' Radio button field collection
Dim radiobuttonFieldCollection As PdfLoadedRadioButtonItemCollection = radiobuttonField.Items
' Radio button field item
Dim radiobuttonItem As PdfLoadedRadioButtonItem = radiobuttonFieldCollection(0)
' Selected the item
radiobuttonItem.Checked = True
doc.Save("LoadedForm.pdf")
doc.Close(True)
- See Also
SelectedIndex
Gets or sets the index of the selected item in the list.
public int SelectedIndex { get; set; }
Property Value
- int
The lowest ordinal index of the selected items in the list. The default is -1, which indicates that nothing is selected.
Examples
//Load an existing document
PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");
// Read the 'Gender' radio button field
PdfLoadedRadioButtonListField radiobuttonField = doc.Form.Fields["Gender"] as PdfLoadedRadioButtonListField;
// Set the selected index as 1
radiobuttonField.SelectedIndex = 1;
// Save the document to a disk
doc.Save("Form.pdf");
doc.Close(true);
'Load an existing document
Dim doc As PdfLoadedDocument = New PdfLoadedDocument("SourceForm.pdf")
' Read the 'Gender' radio button field
Dim radiobuttonField As PdfLoadedRadioButtonListField = TryCast(doc.Form.Fields("Gender"), PdfLoadedRadioButtonListField)
' Set the selected index as 1
radiobuttonField.SelectedIndex = 1
' Save the document to a disk
doc.Save("Form.pdf")
doc.Close(True)
- See Also
SelectedItem
Gets the selected item.[Read-Only]
public PdfLoadedRadioButtonItem SelectedItem { get; }
Property Value
- PdfLoadedRadioButtonItem
Return the item as PdfLoadedRadioButtonItem class
Examples
//Load an existing document
PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");
// Read the 'Gender' radio button field
PdfLoadedRadioButtonListField radiobuttonField = doc.Form.Fields["Gender"] as PdfLoadedRadioButtonListField;
// Read the selected item of the radio button
PdfLoadedRadioButtonItem radiobuttonItem = radiobuttonField.SelectedItem;
// Uncheck the selected item
radiobuttonItem.Checked = false;
// Save the document to a disk
doc.Save("Form.pdf");
doc.Close(true);
'Load an existing document
Dim doc As PdfLoadedDocument = New PdfLoadedDocument("SourceForm.pdf")
' Read the 'Gender' radio button field
Dim radiobuttonField As PdfLoadedRadioButtonListField = TryCast(doc.Form.Fields("Gender"), PdfLoadedRadioButtonListField)
' Read the selected item of the radio button
Dim radiobuttonItem As PdfLoadedRadioButtonItem = radiobuttonField.SelectedItem
' Uncheck the selected item
radiobuttonItem.Checked = False
' Save the document to a disk
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
A string value specifying the value of the first selected item, null (Nothing in VB.NET) if there is no selected item.
Examples
//Load an existing document
PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");
// Read the 'Gender' radio button field
PdfLoadedRadioButtonListField radiobuttonField = doc.Form.Fields["Gender"] as PdfLoadedRadioButtonListField;
// Set the selected index as 1
radiobuttonField.SelectedValue = "Female";
// Save the document to a disk
doc.Save("Form.pdf");
doc.Close(true);
'Load an existing document
Dim doc As PdfLoadedDocument = New PdfLoadedDocument("SourceForm.pdf")
' Read the 'Gender' radio button field
Dim radiobuttonField As PdfLoadedRadioButtonListField = TryCast(doc.Form.Fields("Gender"), PdfLoadedRadioButtonListField)
' Set the selected index as 1
radiobuttonField.SelectedValue = "Female"
' Save the document to a disk
doc.Save("Form.pdf")
doc.Close(True)
- See Also
Value
Gets or sets the value of specified item.
public string Value { get; set; }
Property Value
- string
A string value representing the value of the item.
Examples
//Load an existing document
PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");
// Read the 'Gender' radio button field
PdfLoadedRadioButtonListField radiobuttonField = doc.Form.Fields["Gender"] as PdfLoadedRadioButtonListField;
// Set the radio box value as Male
radiobuttonField.Value = "Male";
// Save the document to a disk
doc.Save("Form.pdf");
doc.Close(true);
'Load an existing document
Dim doc As PdfLoadedDocument = New PdfLoadedDocument("SourceForm.pdf")
' Read the 'Gender' radio button field
Dim radiobuttonField As PdfLoadedRadioButtonListField = TryCast(doc.Form.Fields("Gender"), PdfLoadedRadioButtonListField)
' Set the radio box value as Male
radiobuttonField.Value = "Male"
' Save the document to a disk
doc.Save("Form.pdf")
doc.Close(True)
- See Also
Methods
Remove(PdfLoadedRadioButtonItem)
Remove the particular PdfLoadedRadioButtonItem from PdfLoadedRadioButtonListField.
public void Remove(PdfLoadedRadioButtonItem item)
Parameters
Examples
//Load an existing document
PdfLoadedDocument loadedDocument = new PdfLoadedDocument("input.pdf");
//Get the loaded form.
PdfLoadedForm loadedForm = loadedDocument.Form;
//Get the RadioButtonList field
PdfLoadedRadioButtonListField radioButtonField = loadedForm.Fields[0] as PdfLoadedRadioButtonListField;
//Get the RadioButtonField item
PdfLoadedRadioButtonItem radioButtonFieldItem = radioButtonField.Items[0] as PdfLoadedRadioButtonItem;
//Remove the radioButtonField item
loadedField.Remove(radioButtonFieldItem);
//Save the modified document.
loadedDocument.Save("form.pdf");
//Close the document
loadedDocument.Close(true);
- See Also
RemoveAt(int)
Remove the PdfLoadedRadioButtonListField 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 radioButton Field
PdfLoadedRadioButtonListField radioButtonField = loadedForm.Fields[0] as PdfLoadedRadioButtonListField;
//Remove the radioButtonField item
radioButtonField.RemoveAt(0);
//Save the modified document.
loadedDocument.Save("form.pdf");
//Close the document
loadedDocument.Close(true);
- See Also