Class PdfLoadedListBoxField
Represents loaded list box field.
Inheritance
System.Object
PdfLoadedListBoxField
Implements
System.ComponentModel.INotifyPropertyChanged
Inherited Members
Namespace: Syncfusion.Pdf.Parsing
Assembly: Syncfusion.Pdf.NET.dll
Syntax
public class PdfLoadedListBoxField : PdfLoadedChoiceField, IPdfWrapper, INotifyPropertyChanged
Examples
//Load an existing document
PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");
// Load the list box field
PdfLoadedListBoxField listField = doc.Form.Fields["Course"] as PdfLoadedListBoxField;
// Flatten the list field
listField.Flatten = true;
doc.Save("Form.pdf");
doc.Close(true);
'Load an existing document
Dim doc As PdfLoadedDocument = New PdfLoadedDocument("SourceForm.pdf")
' Load the list box field
Dim listField As PdfLoadedListBoxField = TryCast(doc.Form.Fields("Course"), PdfLoadedListBoxField)
' Flatten the list field
listField.Flatten = True
doc.Save("Form.pdf")
doc.Close(True)
Properties
ComplexScript
Gets or sets the complex script language support.
Declaration
public bool ComplexScript { get; set; }
Property Value
Type |
---|
System.Boolean |
Examples
//Load existing PDF document.
PdfLoadedDocument ldoc = new PdfLoadedDocument("form.pdf");
//Load the existing list box field.
PdfLoadedListBoxField list = lfied as PdfLoadedListBoxField;
//Create font.
Font font = new Font("Tahoma", 10f);
//Create a new PDF font instance.
PdfFont pdfFont = new PdfTrueTypeFont(font, FontStyle.Regular, 10f, true, true);
//Set font.
list.Font = pdfFont;
//Enable complex script support.
list.ComplexScript = true;
ldoc.Form.SetDefaultAppearance(false);
//Save the document.
ldoc.Save("output.pdf");
//Close the document.
ldoc.Close(true);
'Load existing PDF document.
Dim ldoc As New PdfLoadedDocument("form.pdf")
'Load the existing list box field.
Dim list As PdfLoadedListBoxField = TryCast(ldoc.Form.Fields(0), PdfLoadedListBoxField)
'Create font.
Dim font As New Font("Tahoma", 10F)
'Create a new PDF font instance.
Dim pdfFont As PdfFont = New PdfTrueTypeFont(font, FontStyle.Regular, 10F, True, True)
'Set font.
list.Font = pdfFont
'Enable complex script support.
list.ComplexScript = True
ldoc.Form.SetDefaultAppearance(False)
'Save the document.
ldoc.Save("output.pdf")
'Close the document.
ldoc.Close(True)
Items
Gets the collection of list field.[Read-Only]
Declaration
public PdfLoadedListFieldItemCollection Items { get; }
Property Value
Type | Description |
---|---|
PdfLoadedListFieldItemCollection | The collection of list box items. |
Examples
// Loads an existing document
PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");
// Load the list box field
PdfLoadedListBoxField listField = doc.Form.Fields["Course"] as PdfLoadedListBoxField;
// List box items collection
PdfLoadedListFieldItemCollection listcollection = listField.Items;
listcollection[0].Location = new PointF(100, 200);
doc.Save("Sample.pdf");
doc.Close(true);
' Loads an existing document
Dim doc As PdfLoadedDocument = New PdfLoadedDocument("SourceForm.pdf")
' Load the list box field
Dim listField As PdfLoadedListBoxField = TryCast(doc.Form.Fields("Course"), PdfLoadedListBoxField)
' List box items collection
Dim listcollection As PdfLoadedListFieldItemCollection = listField.Items
listcollection(0).Location = New PointF(100, 200)
doc.Save("Sample.pdf")
doc.Close(True)
See Also
MultiSelect
Gets or sets a value indicating whether the field is multi-selectable.
Declaration
public bool MultiSelect { get; set; }
Property Value
Type |
---|
System.Boolean |
Examples
// Loads an existing document
PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");
// Load the list box field
PdfLoadedListBoxField listField = doc.Form.Fields["Course"] as PdfLoadedListBoxField;
// Enabling the multi selection option
listField.MultiSelect = true;
doc.Save("Sample.pdf");
doc.Close(true);
' Loads an existing document
Dim doc As PdfLoadedDocument = New PdfLoadedDocument("SourceForm.pdf")
' Load the list box field
Dim listField As PdfLoadedListBoxField = TryCast(doc.Form.Fields("Course"), PdfLoadedListBoxField)
' Enabling the multi selection option
listField.MultiSelect = True
doc.Save("Sample.pdf")
doc.Close(True)
See Also
Methods
Remove(PdfLoadedListFieldItem)
Remove the particular PdfLoadedListFieldItem from PdfLoadedListBoxField.
Declaration
public void Remove(PdfLoadedListFieldItem item)
Parameters
Type | Name | Description |
---|---|---|
PdfLoadedListFieldItem | item |
Examples
//Load an existing document
PdfLoadedDocument loadedDocument = new PdfLoadedDocument("input.pdf");
//Get the loaded form.
PdfLoadedForm loadedForm = loadedDocument.Form;
//Get the listBox field
PdfLoadedListBoxField listBoxField = loadedForm.Fields[0] as PdfLoadedListBoxField;
//Get the listBoxField item
PdfLoadedListFieldItem listBoxFieldItem = listBoxField.Items[0] as PdfLoadedListFieldItem;
//Remove the listBoxField item
loadedField.Remove(listBoxFieldItem);
//Save the modified document.
loadedDocument.Save("form.pdf");
//Close the document
loadedDocument.Close(true);
RemoveAt(Int32)
Remove the PdfLoadedListBoxField 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 listBoxField
PdfLoadedListBoxField listBoxField = loadedForm.Fields[0] as PdfLoadedListBoxField;
//Remove the listBoxField item
listBoxField.RemoveAt(0);
//Save the modified document.
loadedDocument.Save("form.pdf");
//Close the document
loadedDocument.Close(true);
Implements
System.ComponentModel.INotifyPropertyChanged