Back to Devexpress

PdfFormData.GetFieldNames() Method

officefileapi-devexpress-dot-pdf-dot-pdfformdata.md

latest3.8 KB
Original Source

PdfFormData.GetFieldNames() Method

Returns the child field names for a particular tree node.

Namespace : DevExpress.Pdf

Assembly : DevExpress.Pdf.v25.2.Core.dll

NuGet Package : DevExpress.Pdf.Core

Declaration

csharp
public IList<string> GetFieldNames()
vb
Public Function GetFieldNames As IList(Of String)

Returns

TypeDescription
IList<String>

A list of child field names for a particular tree node.

|

Example

The following example demonstrates how to obtain a list of current fields in a PDF Form:

View Example

csharp
// Load a document with an interactive form.
using (PdfDocumentProcessor documentProcessor = new PdfDocumentProcessor()) {
    documentProcessor.LoadDocument(filePath + fileName + ".pdf");

    // Get names of interactive form fields.
    PdfFormData formData = documentProcessor.GetFormData();
    IList<string> names = formData.GetFieldNames();

    // Show the field names in the rich text box.
    string[] strings = new string[names.Count];
    names.CopyTo(strings, 0);
    richTextBox1.Lines = strings;
}
vb
' Load a document with an interactive form.
Using documentProcessor As New PdfDocumentProcessor()
    documentProcessor.LoadDocument(filePath & fileName & ".pdf")

    ' Get names of interactive form fields.
    Dim formData As PdfFormData = documentProcessor.GetFormData()
    Dim names As IList(Of String) = formData.GetFieldNames()

    ' Show the field names in the rich text box.
    Dim strings(names.Count - 1) As String
    names.CopyTo(strings, 0)
    richTextBox1.Lines = strings
End Using

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the GetFieldNames() method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

pdf-document-api-fill-interactive-form-fields/CS/PdfFormFilling/PdfFormFilling.cs#L27

csharp
PdfFormData formData = documentProcessor.GetFormData();
IList<string> names = formData.GetFieldNames();

pdf-document-api-fill-interactive-form-fields/VB/PdfFormFilling/PdfFormFilling.vb#L27

vb
Dim formData As PdfFormData = documentProcessor.GetFormData()
Dim names As IList(Of String) = formData.GetFieldNames()
' Show the field names in the rich text box.

See Also

PdfFormData Class

PdfFormData Members

DevExpress.Pdf Namespace