Class PdfLoadedListBoxField
- Namespace
- Syncfusion.Pdf.Parsing
- Assembly
- Syncfusion.Pdf.Portable.dll
Represents loaded list box field.
public class PdfLoadedListBoxField : PdfLoadedChoiceField, INotifyPropertyChanged
- Inheritance
-
PdfLoadedListBoxField
- Implements
- Inherited Members
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.
public bool ComplexScript { get; set; }
Property Value
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)
- See Also
Items
Gets the collection of list field.[Read-Only]
public PdfLoadedListFieldItemCollection Items { get; }
Property Value
- 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.
public bool MultiSelect { get; set; }
Property Value
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.
public void Remove(PdfLoadedListFieldItem item)
Parameters
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);
- See Also
RemoveAt(int)
Remove the PdfLoadedListBoxField 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 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);
- See Also