PDFOne .NET
Powerful all-in-one PDF library for .NET
Compatibility
VS 2005/2008/2010/2012/2013

How to flatten PDF form fields or AcroForms using PDFOne .NET

Learn to make AcroForms non-interactive using C# or VB.

AcroForms is an interactive feature of PDF that has been one of the main reasons for its popularity and success. Sometimes, however, you need to get rid of all interactivity from the form fields. This is done to make the form fields read-only with whatever values that had been entered by the end-users who submitted them. This is usually done prior to archiving the PDF documents in a storage system. The process of removing the interactive features from a PDF form is called form flattening.

With PDFOne .NET, form flattening is a simple affair. Load a document and call the FlattenFormFields() method. This method is available for both PDFDocument and PDFPage classes. In this former, the method accepts a page range. In the latter, the method affects form fields in the instant PDF page.

PDF Form Flattening Example

private void button1_Click(object sender, EventArgs e) {
  PDFDocument doc = new PDFDocument("your-license-key");
  doc.Load("forms_doc.pdf");

  doc.FlattenFormFields("1");  // Flattens form fields on page 1
            
  doc.Save("flattened_forms_doc.pdf");
  doc.Close();
}

Here is the input PDF forms document.

And, here is the modified flattened PDF document. It looks the same but the form fields are not interactive anymore.

You can download both documents and see for yourself.

---o0O0o---

Our .NET Developer Tools
Gnostice Document Studio .NET

Multi-format document-processing component suite for .NET developers.

PDFOne .NET

A .NET PDF component suite to create, edit, view, print, reorganize, encrypt, annotate, and bookmark PDF documents in .NET applications.

Our Delphi/C++Builder developer tools
Gnostice Document Studio Delphi

Multi-format document-processing component suite for Delphi/C++Builder developers, covering both VCL and FireMonkey platforms.

eDocEngine VCL

A Delphi/C++Builder component suite for creating documents in over 20 formats and also export reports from popular Delphi reporting tools.

PDFtoolkit VCL

A Delphi/C++Builder component suite to edit, enhance, view, print, merge, split, encrypt, annotate, and bookmark PDF documents.

Our Java developer tools
Gnostice Document Studio Java

Multi-format document-processing component suite for Java developers.

PDFOne (for Java)

A Java PDF component suite to create, edit, view, print, reorganize, encrypt, annotate, bookmark PDF documents in Java applications.

Our Platform-Agnostic Cloud and On-Premises APIs
StarDocs

Cloud-hosted and On-Premises REST-based document-processing and document-viewing APIs

Privacy | Legal | Feedback | Newsletter | Blog | Resellers © 2002-2025 Gnostice Information Technologies Private Limited. All rights reserved.