How to Flatten PDF Comments Without Losing Editable Content
Question details
The user needs to lock comments and markups in a technical PDF so they cannot be altered, while ensuring the rest of the document remains editable and without suffering the quality loss and file size increase caused by printing to PDF.

- Product
- Adobe Acrobat Pro / PDF
- Device & OS
- not provided
- Scenario
- Finalizing technical PDF documents where annotations must be permanently fixed, but other document elements need to remain interactive.
- Observed behavior
- Using the 'Print to PDF' function reduces the visual quality of the document and significantly increases the file size.
Always create and save a duplicate copy of your original PDF file before proceeding, as the flattening process permanently merges comments into the page content and cannot be undone.
Use JavaScript to Flatten Pages in Acrobat Pro
Execute a built-in JavaScript command within Acrobat Pro to flatten annotations directly into the page content, preserving document quality without needing to 'Print to PDF'.
This method converts annotations, markups, and drawing objects into standard page content. Because it does not re-render the entire document like the print function does, it maintains your original text quality and keeps file sizes manageable.
Open your technical PDF in Adobe Acrobat Pro. Press 'Ctrl + J' (Windows) or 'Cmd + J' (Mac) to open the interactive JavaScript Debugger console.
In the console window, type the exact command: this.flattenPages();
Highlight the code you just typed, then press 'Ctrl + Enter' (or the Enter key on your numeric keypad) to run the script. The comments will instantly merge with the page.
Click 'File' > 'Save' to apply the changes to your document.

A Simpler Way to Manage and Flatten PDFs
WPS PDF provides an intuitive way to manage, edit, and flatten PDF documents without needing to write or execute JavaScript code. Easily lock your comments while keeping your document's high quality intact.
- 1. Open your PDF in WPS: Download and launch WPS Office, then open the PDF file you wish to flatten.
- 2. Review Annotations: Navigate to the 'Comment' tab to ensure all your markups and technical edits are placed exactly where you want them.
- 3. Export as Flattened PDF: Go to the 'Menu' or 'Protect' tab and select the option to save or export the document as a flattened PDF, locking the annotations instantly.

Frequently Asked Questions
Why does printing to PDF reduce document quality?
Printing to PDF effectively takes a snapshot of each page and reconstructs it. This process can rasterize text, compress high-resolution images, and strip away vector data, resulting in lower visual quality and larger file sizes.
What exactly does flattening a PDF do?
Flattening merges interactive elements like annotations, signatures, form fields, and floating comments directly into the primary visual background layer of the page. This makes them uneditable while fully retaining their appearance.
Can I unflatten a PDF after saving?
No, flattening a PDF permanently alters the document's underlying structure. Once the flattened file is saved and closed, the action cannot be reversed, which is why creating a backup beforehand is crucial.




