Table of Contents

Class PdfLoadedStateField

Namespace
Syncfusion.Pdf.Parsing
Assembly
Syncfusion.Pdf.Portable.dll

Represents the base class for loaded state field.

public abstract class PdfLoadedStateField : PdfLoadedStyledField, INotifyPropertyChanged
Inheritance
PdfLoadedStateField
Implements
Derived
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 items collection.[Read-Only]

public PdfLoadedStateItemCollection Items { get; }

Property Value

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.

public void Remove(PdfLoadedStateItem item)

Parameters

item PdfLoadedStateItem

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);
See Also

RemoveAt(int)

Remove the PdfLoadedStateField 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 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);
See Also

SetCheckedStatus(bool)

Sets checked status of the field.

protected void SetCheckedStatus(bool value)

Parameters

value bool

Checked status.

See Also

See Also