Class PdfLoadedStateField
Represents the base class for loaded state field.
Inheritance
System.Object
PdfLoadedStateField
Implements
System.ComponentModel.INotifyPropertyChanged
Inherited Members
Namespace: Syncfusion.Pdf.Parsing
Assembly: Syncfusion.Pdf.Base.dll
Syntax
public abstract class PdfLoadedStateField : PdfLoadedStyledField, IPdfWrapper, INotifyPropertyChanged
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 items collection.[Read-Only]
Declaration
public PdfLoadedStateItemCollection Items { get; }
Property Value
Type |
---|
PdfLoadedStateItemCollection |
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];
// Set the first item as selected item
radiobuttonItem.Selected = true;
doc.Save("Form.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)
' Set the first item as selected item
radiobuttonItem.Selected = True
doc.Save("Form.pdf")
doc.Close(True)
See Also
Methods
Remove(PdfLoadedStateItem)
Remove the particular PdfLoadedStateItem from PdfLoadedStateField.
Declaration
public void Remove(PdfLoadedStateItem item)
Parameters
Type | Name | Description |
---|---|---|
PdfLoadedStateItem | item |
Examples
//Load an existing document
PdfLoadedDocument loadedDocument = new PdfLoadedDocument("input.pdf");
//Get the loaded form.
PdfLoadedForm loadedForm = loadedDocument.Form;
//Get the stateField
PdfLoadedStateField stateField = loadedForm.Fields[0] as PdfLoadedStateField;
//Get the stateField Item
PdfLoadedStateItem stateFieldItem = stateField.Items[0] as PdfLoadedStateItem;
//Remove the stateField item
loadedField.Remove(stateFieldItem);
//Save the modified document.
loadedDocument.Save("form.pdf");
//Close the document
loadedDocument.Close(true);
RemoveAt(Int32)
Remove the PdfLoadedStateField 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 stateField
PdfLoadedStateField stateField = loadedForm.Fields[0] as PdfLoadedStateField;
//Remove the stateField item
stateField.RemoveAt(0);
//Save the modified document.
loadedDocument.Save("form.pdf");
//Close the document
loadedDocument.Close(true);
SetCheckedStatus(Boolean)
Sets checked status of the field.
Declaration
protected void SetCheckedStatus(bool value)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | value | Checked status. |
Implements
System.ComponentModel.INotifyPropertyChanged