PDF Editing Issues

How to Flatten PDF Comments Without Flattening Form Fields

John WilsonJohn Wilson Oct 28, 2026 869 views

Question details

The user wants to flatten comments and annotations in a PDF to make them permanent without affecting the interactivity of fillable form fields.

How to Flatten PDF Comments Without Flattening Form Fields
Product
PDF Editor
Device & OS
not provided
Scenario
Securing or finalizing annotations on a fillable PDF document before distributing it for data entry.
Observed behavior
Standard flattening tools merge both comments and form fields into the base document, removing the ability for users to fill out the form fields.
Before you start

Save a backup copy of your original PDF document before applying JavaScript commands, as flattening is a permanent action that cannot be easily undone.

Solution 1Recommended

Use JavaScript Console to Flatten Only Printing Elements

By temporarily setting form fields to a non-printing state, you can use a JavaScript command to flatten only the visible comments and annotations.

1
Change Form Field Properties

Open your PDF editor's form preparation tool. Select all interactive form fields, open their Properties, and set their visibility to 'Hidden' or 'Visible but doesn't print'.

2
Open the JavaScript Console

Access the JavaScript Debugger or Console in your advanced PDF software (for example, by pressing Ctrl+J in Adobe Acrobat).

3
Execute the Flatten Command

Type the following code into the console: this.flattenPages({nNonPrint: 1}); and execute it. This flattens the document while ignoring the non-printing interactive elements.

4
Restore Form Fields

Go back to the form field properties and change their visibility settings back to 'Visible' so they can be securely filled out by the end users.

Use JavaScript Console to Flatten Only Printing Elements
JavaScript Support: This method requires a PDF editor that supports executing document-level JavaScript from a debugger console.
Comprehensive PDF Editor

Manage PDF Comments and Forms Easily with WPS Office

WPS Office provides a powerful PDF editor that allows you to effortlessly manage annotations, comments, and fillable forms. You can secure your documents, manage interactive elements, and maintain form usability without dealing with complex coding.

  1. 1. Open your PDF in WPS Office: Launch WPS Office and open your fillable PDF document using the built-in WPS PDF tool.
  2. 2. Manage Comments and Annotations: Navigate to the 'Comment' tab to review, consolidate, or secure your annotations as needed before finalizing the file.
  3. 3. Save and Distribute: Use the 'Save As' feature or document protection settings to finalize your PDF while ensuring form fields remain perfectly active for the recipient.
Easily add, edit, or flatten PDF comments and annotations to secure your document.Fully compatible with standard PDF forms and Microsoft Office document formats.Lightweight and user-friendly interface for seamless PDF reading and editing.Cross-platform support for Windows, Mac, iOS, and Android devices.
microsoft office alternative - wps office

Frequently Asked Questions

What does it mean to flatten a PDF?

Flattening a PDF merges all interactive elements, such as comments, annotations, and form fields, into a single background layer of the document. This makes the visual elements permanent and uneditable.

Why do my form fields disappear when I flatten a PDF?

Standard flattening processes compress all document layers, including interactive form fields, converting them into static text and images. To prevent this, you must explicitly exclude form fields from the flattening command.

Can I unflatten a PDF after saving it?

No, flattening is a permanent process. Once a flattened PDF is saved and closed, you cannot revert the static text or comments back into editable layers. Always keep a backup of the original document.

Is there a way to flatten only specific pages?

Yes, when using JavaScript commands like this.flattenPages(), you can specify page ranges (e.g., setting an nStart and nEnd parameter) to limit the flattening action to certain pages while leaving the rest of the document fully interactive.