Skip to main content

PdfDocumentProcessor.RemoveForm() Method

Removes all interactive form fields from a PDF document.

Namespace: DevExpress.Pdf

Assembly: DevExpress.Docs.v23.2.dll

NuGet Package: DevExpress.Document.Processor


public bool RemoveForm()


Type Description

If form fields were removed from a PDF document, the value is true; otherwise, false.


The RemoveForm method returns true if an interactive form is successfully removed from a PDF document. If a PDF document does not contain an interactive form, this method returns false.


This example shows how to remove a particular form field and a whole interactive form from a PDF document.

To remove all form fields from a document, call the PdfDocumentProcessor.RemoveForm method.

If the interactive form is removed successfully, this method returns true. If the document doesn’t contain an interactive form that should be removed, this method returns false.

To remove a particular form field by its name, call the PdfDocumentProcessor.RemoveFormField method and pass a field name as an argument to this method.

The PdfDocumentProcessor.RemoveFormField method tries to find the field in a document using the field name. If this field is found in the document, then it will be removed from a document and this method returns true; otherwise, it returns false.

View Example

using DevExpress.Pdf;
using System;

namespace RemoveInteractiveForm {
    class Program {
        static void Main(string[] args) {
            using (PdfDocumentProcessor processor = new PdfDocumentProcessor()) {

                // Load a document with an interactive form.

                // Remove a form field by its name.
                if (processor.RemoveFormField("FirstName"))

                    // Save the modified document.


                    // Show a message if the form field was not found in a document.
                    Console.WriteLine("The form field was not removed from a document. Make sure, the form field exists in the document.");

                // Remove the whole interactive form.
                if (processor.RemoveForm())

                    // Save the modified document.


                    // Show a message if the interactive form was not found in a document.
                    Console.WriteLine("The interactive form was not removed from a document. Make sure the interactive form exists in the document.");

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


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.

See Also