[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Collapse]Office File API
  Demo Application
  Redistribution and Deployment
 [Expand]Spreadsheet Document API
 [Expand]Word Processing Document API
 [Collapse]PDF Document API
   Getting Started
   Coordinate Systems
   Document Generation
  [Expand]PDF Graphics
  [Expand]Document Manipulation
  [Expand]Additional Content
  [Collapse]Interactive Forms
    Interactive Form Filling
    Interactive Form Flattening
    Creating Interactive Form
    Deleting Interactive Form
    Export and Import Interactive Form Data
  [Expand]Text Markup Annotations
  [Expand]Document Security
  [Expand]Examples
 [Expand]Excel Export Library
 [Expand]Snap Report API
 [Expand]Zip Compression and Archive API
 [Expand]Barcode Generation API
 [Expand]Unit Conversion API
 [Expand]API Reference
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Deleting Interactive Form

The PDF Document API provides methods that allow you to remove an interactive form field or a whole interactive form from a PDF document.

Expanded Removing Form Field

To remove a particular interactive form field by its name:

  • Create an instance of the PdfDocumentProcessor class;

  • Load a PDF document that contains an interactive form field using one of the overloaded PdfDocumentProcessor.LoadDocument methods;

  • If you do not know the name of an interactive form field that should be removed, obtain names of interactive form fields by calling the PdfDocumentProcessor.GetFormFieldNames method;

  • Remove a desired form field in the interactive form. To do this, call the PdfDocumentProcessor.RemoveFormField method and pass a field name as an argument to this method.

    This method tries to find the field in a document using the field name. If it finds this field, the method removes it from the document and returns true; otherwise, it returns false.

See the code snippet below.

Show Me

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=T494240.

Expanded Removing Interactive Form

To remove all form fields from a document:

See the code snippet below.

Show Me

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=T494240.

Is this topic helpful?​​​​​​​