How to Flatten PDF Comments Without Flattening Form Fields
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.

- 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.
Save a backup copy of your original PDF document before applying JavaScript commands, as flattening is a permanent action that cannot be easily undone.
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.
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'.
Access the JavaScript Debugger or Console in your advanced PDF software (for example, by pressing Ctrl+J in Adobe Acrobat).
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.
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.

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. Open your PDF in WPS Office: Launch WPS Office and open your fillable PDF document using the built-in WPS PDF tool.
- 2. Manage Comments and Annotations: Navigate to the 'Comment' tab to review, consolidate, or secure your annotations as needed before finalizing the file.
- 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.

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.




