Table of Contents

Class PdfLoadedListItemCollection

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

Represents a collection of list box field items.

public class PdfLoadedListItemCollection : PdfCollection, IEnumerable
Inheritance
PdfLoadedListItemCollection
Implements
Inherited Members

Examples

//Load an existing document.
PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");
// Getting the 'course' list box field          
PdfLoadedListBoxField listField = doc.Form.Fields["Course"] as PdfLoadedListBoxField;       
// List field item Collection
PdfLoadedListItemCollection listItemCollection = listField.Values;
// Create a new list item
PdfLoadedListItem listItem = new PdfLoadedListItem("Oracle", "Oracle");
// Adding item in collection
listItemCollection.Add(listItem);            
doc.Save("LoadedForm.pdf");
doc.Close(true);
'Load an existing document
Dim doc As PdfLoadedDocument = New PdfLoadedDocument("SourceForm.pdf")
' Getting the 'course' list box field          
Dim listField As PdfLoadedListBoxField = TryCast(doc.Form.Fields("Course"), PdfLoadedListBoxField)
' List field item Collection
Dim listItemCollection As PdfLoadedListItemCollection = listField.Values
' Create a new list item
Dim listItem As PdfLoadedListItem = New PdfLoadedListItem("Oracle", "Oracle")
' Adding item in collection
listItemCollection.Add(listItem)
doc.Save("LoadedForm.pdf")
doc.Close(True)

Properties

this[int]

Gets the PdfLoadedListItem at the specified index.[Read-Only]

public PdfLoadedListItem this[int index] { get; }

Parameters

index int

Property Value

PdfLoadedListItem

Examples

//Load an existing document.
PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");         
// Getting the 'course' list box field
PdfLoadedListBoxField listField = doc.Form.Fields["Course"] as PdfLoadedListBoxField;
// List field item Collection
PdfLoadedListItemCollection listItemCollection = listField.Values;
// Getting the first item from the list item collection
PdfLoadedListItem listItem = listItemCollection[0];
listItem.Value = "C#.NET";
doc.Save("Form.pdf");
doc.Close(true);
'Load an existing document.
Dim doc As PdfLoadedDocument = New PdfLoadedDocument("SourceForm.pdf")
' Getting the 'course' list box field
Dim listField As PdfLoadedListBoxField = TryCast(doc.Form.Fields("Course"), PdfLoadedListBoxField)
' List field item Collection
Dim listItemCollection As PdfLoadedListItemCollection = listField.Values
' Getting the first item from the list item collection
Dim listItem As PdfLoadedListItem = listItemCollection(0)
listItem.Value = "C#.NET"
doc.Save("Form.pdf")
doc.Close(True)
See Also

Methods

Add(PdfLoadedListItem)

Inserts an list item at the end of the collection.

public int Add(PdfLoadedListItem item)

Parameters

item PdfLoadedListItem

a PdfLoadedListItemobject to be added to collection.

Returns

int

The index of item.

Examples

//Load an existing document.
PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");
// Getting the 'course' list box field          
PdfLoadedListBoxField listField = doc.Form.Fields["Course"] as PdfLoadedListBoxField;       
// List field item Collection
PdfLoadedListItemCollection listItemCollection = listField.Values;
// Create a new list item
PdfLoadedListItem listItem = new PdfLoadedListItem("Oracle", "Oracle");
// Adding item in collection
listItemCollection.Add(listItem);            
doc.Save("LoadedForm.pdf");
doc.Close(true);
'Load an existing document
Dim doc As PdfLoadedDocument = New PdfLoadedDocument("SourceForm.pdf")
' Getting the 'course' list box field          
Dim listField As PdfLoadedListBoxField = TryCast(doc.Form.Fields("Course"), PdfLoadedListBoxField)
' List field item Collection
Dim listItemCollection As PdfLoadedListItemCollection = listField.Values
' Create a new list item
Dim listItem As PdfLoadedListItem = New PdfLoadedListItem("Oracle", "Oracle")
' Adding item in collection
listItemCollection.Add(listItem)
doc.Save("LoadedForm.pdf")
doc.Close(True)
See Also

Clear()

Clears the item collection.

public void Clear()

Examples

//Load an existing document.
PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");         
// Getting the 'course' list box field
PdfLoadedListBoxField listField = doc.Form.Fields["Course"] as PdfLoadedListBoxField;
// List field item Collection
PdfLoadedListItemCollection listItemCollection = listField.Values;
// Clears the collection
listItemCollection.Clear();
doc.Save("Form.pdf");
doc.Close(true);
'Load an existing document.
Dim doc As PdfLoadedDocument = New PdfLoadedDocument("SourceForm.pdf")
' Getting the 'course' list box field
Dim listField As PdfLoadedListBoxField = TryCast(doc.Form.Fields("Course"), PdfLoadedListBoxField)
' List field item Collection
Dim listItemCollection As PdfLoadedListItemCollection = listField.Values
' Clears the collection
listItemCollection.Clear()
doc.Save("Form.pdf")
doc.Close(True)
See Also

Insert(int, PdfLoadedListItem)

Inserts the list item at the specified index.

public void Insert(int index, PdfLoadedListItem item)

Parameters

index int

The index.

item PdfLoadedListItem

The item.

Examples

//Load an existing document.
PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");         
// Getting the 'course' list box field
PdfLoadedListBoxField listField = doc.Form.Fields["Course"] as PdfLoadedListBoxField;
// List field item Collection
PdfLoadedListItemCollection listItemCollection = listField.Values;
// Getting the first item from the list item collection
PdfLoadedListItem listItem = listItemCollection[0];
// Insert the item at first index
listItemCollection.Insert(0, listItem);   
doc.Save("Form.pdf");
doc.Close(true);
'Load an existing document.
Dim doc As PdfLoadedDocument = New PdfLoadedDocument("SourceForm.pdf")
' Getting the 'course' list box field
Dim listField As PdfLoadedListBoxField = TryCast(doc.Form.Fields("Course"), PdfLoadedListBoxField)
' List field item Collection
Dim listItemCollection As PdfLoadedListItemCollection = listField.Values
' Getting the first item from the list item collection
Dim listItem As PdfLoadedListItem = listItemCollection(0)
' Insert the item at first index
listItemCollection.Insert(0, listItem)
doc.Save("Form.pdf")
doc.Close(True)
See Also

RemoveAt(int)

Removes the list item at the specified index.

public void RemoveAt(int index)

Parameters

index int

The index.

Examples

//Load an existing document.
PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");         
// Getting the 'course' list box field
PdfLoadedListBoxField listField = doc.Form.Fields["Course"] as PdfLoadedListBoxField;
// List field item Collection
PdfLoadedListItemCollection listItemCollection = listField.Values;
// Remove the first item
listItemCollection.RemoveAt(0);
doc.Save("Form.pdf");
doc.Close(true);
'Load an existing document.
Dim doc As PdfLoadedDocument = New PdfLoadedDocument("SourceForm.pdf")
' Getting the 'course' list box field
Dim listField As PdfLoadedListBoxField = TryCast(doc.Form.Fields("Course"), PdfLoadedListBoxField)
' List field item Collection
Dim listItemCollection As PdfLoadedListItemCollection = listField.Values
' Remove the first item
listItemCollection.RemoveAt(0)
doc.Save("Form.pdf")
doc.Close(True)

Remarks

Throws IndexOutOfRange exception if the index is out of bounds.

See Also

See Also