Table of Contents

Class PdfLoadedField

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

Represents base class for loaded fields.

public abstract class PdfLoadedField : PdfField, INotifyPropertyChanged
Inheritance
PdfLoadedField
Implements
Derived
Inherited Members

Examples

//Create a new document.
PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");
//load the form fields
foreach (PdfLoadedField field in doc.Form.Fields)
{
  // Flatten the form
  field.Flatten = true;
}
doc.Save("Form.pdf");
doc.Close(true);
 'Create a new document
Dim doc As PdfLoadedDocument = New PdfLoadedDocument("SourceForm.pdf")
'load the form fields
For Each field As PdfLoadedField In doc.Form.Fields
  ' Flatten the form
field.Flatten = True
Next field
doc.Save("Form.pdf")
doc.Close(True)

Fields

ObjectID

Form field identifier

public int ObjectID

Field Value

int
See Also

Properties

Export

Gets or sets a value indicating whether this PdfLoadedField is export.

public override bool Export { get; set; }

Property Value

bool

true if export; otherwise, false.

Examples

//Load an existing document.
PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");
//load the form field
PdfLoadedField field = doc.Form.Fields[0] as PdfLoadedField;
field.Export = true;
doc.Save("Form.pdf");
doc.Close(true);
'Load an existing document.
Dim doc As PdfLoadedDocument = New PdfLoadedDocument("SourceForm.pdf")
'load the form field
Dim field As PdfLoadedField = TryCast(doc.Form.Fields(0), PdfLoadedField)
field.Export = True
doc.Save("Form.pdf")
doc.Close(True)
See Also

Form

Gets the form of the PdfLoadedField.[Read-Only]

public PdfForm Form { get; }

Property Value

PdfForm

Examples

//Load an existing document.
PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");
//load the form field
PdfLoadedField field = doc.Form.Fields[0] as PdfLoadedField;
PdfForm form = field.Form;
doc.Save("Form.pdf");
doc.Close(true);
'Load an existing document.
Dim doc As PdfLoadedDocument = New PdfLoadedDocument("SourceForm.pdf")
'load the form field
Dim field As PdfLoadedField = TryCast(doc.Form.Fields(0), PdfLoadedField)
Dim form As PdfForm = field.Form
doc.Save("Form.pdf")
doc.Close(True)
See Also

MappingName

Gets or sets the mapping name to be used when exporting interactive form field data from the document.

public override string MappingName { get; set; }

Property Value

string

A string value specifying the mapping name of the field.

Examples

//Load an existing document.
PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");
//load the form field
PdfLoadedField field = doc.Form.Fields[0] as PdfLoadedField;
// Sets the Mapping name as 'FirstField'
field.MappingName = "FirstField";            
doc.Save("Form.pdf");
doc.Close(true);
'Load an existing document.
Dim doc As PdfLoadedDocument = New PdfLoadedDocument("SourceForm.pdf")
'load the form field
Dim field As PdfLoadedField = TryCast(doc.Form.Fields(0), PdfLoadedField)
' Sets the Mapping name as 'FirstField'
field.MappingName = "FirstField"
doc.Save("Form.pdf")
doc.Close(True)
See Also

Name

Gets the name of the field.[Read-Only]

public override string Name { get; }

Property Value

string

A string value specifying the name of the field.

Examples

//Load an existing document.
PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");
//load the form field
PdfLoadedField field = doc.Form.Fields[0] as PdfLoadedField;
// Read the field name
String fieldName = field.Name;            
doc.Save("Form.pdf");
doc.Close(true);
'Load an existing document.
Dim doc As PdfLoadedDocument = New PdfLoadedDocument("SourceForm.pdf")
'load the form field
Dim field As PdfLoadedField = TryCast(doc.Form.Fields(0), PdfLoadedField)
' Read the field name
Dim fieldName As String = field.Name
doc.Save("Form.pdf")
doc.Close(True)
See Also

Page

Gets the page of the form field.[Read-Only]

public override PdfPageBase Page { get; }

Property Value

PdfPageBase

Examples

//Load an existing document.
PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");
//load the form field
PdfLoadedField field = doc.Form.Fields[0] as PdfLoadedField;
PdfPageBase page = field.Page;  
doc.Save("Form.pdf");
doc.Close(true);
'Load an existing document.
Dim doc As PdfLoadedDocument = New PdfLoadedDocument("SourceForm.pdf")
'load the form field
Dim field As PdfLoadedField = TryCast(doc.Form.Fields(0), PdfLoadedField)
Dim page As PdfPageBase = field.Page
doc.Save("Form.pdf")
doc.Close(True)
See Also

ReadOnly

Gets or sets a value indicating whether [read-only].

public override bool ReadOnly { get; set; }

Property Value

bool

True if the field is read-only, false otherwise. Default is false.

Examples

//Load an existing document.
PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");
//load the form field
PdfLoadedField field = doc.Form.Fields[0] as PdfLoadedField;
// Set the form field as read only
field.ReadOnly = true;
doc.Save("Form.pdf");
doc.Close(true);
'Load an existing document.
Dim doc As PdfLoadedDocument = New PdfLoadedDocument("SourceForm.pdf")
'load the form field
Dim field As PdfLoadedField = TryCast(doc.Form.Fields(0), PdfLoadedField)
' Set the form field as read only
field.ReadOnly = True
doc.Save("Form.pdf")
doc.Close(True)
See Also

Required

Gets or sets a value indicating whether this PdfLoadedField is required.

public override bool Required { get; set; }

Property Value

bool

True if the field is required, false otherwise. Default is false.

Examples

//Load an existing document.
PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");
//load the form field
PdfLoadedField field = doc.Form.Fields[0] as PdfLoadedField;
field.Required = true;
doc.Save("Form.pdf");
doc.Close(true);
'Load an existing document.
Dim doc As PdfLoadedDocument = New PdfLoadedDocument("SourceForm.pdf")
'load the form field
Dim field As PdfLoadedField = TryCast(doc.Form.Fields(0), PdfLoadedField)
field.Required = True
doc.Save("Form.pdf")
doc.Close(True)
See Also

ToolTip

Gets or sets the tool tip of the form field.

public override string ToolTip { get; set; }

Property Value

string

Examples

//Load an existing document.
PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");
//load the form field
PdfLoadedField field = doc.Form.Fields[0] as PdfLoadedField;
// Sets the tooltip of the field
field.ToolTip = "FirstField";       
doc.Save("Form.pdf");
doc.Close(true);
'Load an existing document.
Dim doc As PdfLoadedDocument = New PdfLoadedDocument("SourceForm.pdf")
'load the form field
Dim field As PdfLoadedField = TryCast(doc.Form.Fields(0), PdfLoadedField)
' Sets the tooltip of the field
field.ToolTip = "FirstField"
doc.Save("Form.pdf")
doc.Close(True)
See Also

Methods

SetName(string)

Sets the name of the field.

public void SetName(string name)

Parameters

name string

New name of the field.

Examples

//Load an existing document.
PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");
//load the form field
PdfLoadedField field = doc.Form.Fields[0] as PdfLoadedField;
// Sets new name of the first field
field.SetName("fieldFirstName");
doc.Save("Form.pdf");
doc.Close(true);
'Load an existing document.
Dim doc As PdfLoadedDocument = New PdfLoadedDocument("SourceForm.pdf")
'load the form field
Dim field As PdfLoadedField = TryCast(doc.Form.Fields(0), PdfLoadedField)
' Sets new name of the first field
field.SetName("fieldFirstName")
doc.Save("Form.pdf")
doc.Close(True)
See Also

See Also