How to Flatten PDF Text Boxes to Prevent Editing in Acrobat
Question details
The user needs to flatten text boxes added to a PDF so that the text becomes an uneditable part of the core page content rather than a removable annotation.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Securing or finalizing a PDF document before distributing it to others, ensuring that annotations like text boxes cannot be modified, moved, or deleted.
- Observed behavior
- Text boxes added as annotations remain interactive and editable by default when the PDF is opened by other users.
Always save a backup copy of your original PDF document before flattening, as this process permanently merges annotations into the page and cannot be easily undone.
Use JavaScript in Adobe Acrobat to Flatten Pages
Execute a built-in JavaScript command in Acrobat to permanently convert all page annotations, including text boxes, into base page content.
Flattening a PDF integrates interactive elements like text boxes, form fields, and annotations directly into the base layer of the document. This ensures the document appears exactly as intended without allowing recipients to edit those specific additions.
Launch Adobe Acrobat and open the PDF file you wish to flatten. Press 'Ctrl+J' on Windows or 'Cmd+J' on Mac to open the JavaScript Debugger console.
In the console window, select 'Console' from the View drop-down if it isn't already active. Click inside the blank text area and type the exact command: 'this.flattenPages();' without the quotes.
Highlight the code you just typed, and press 'Ctrl+Enter' (Windows) or 'Cmd+Enter' (Mac) on your keyboard to execute it. Alternatively, click the 'Execute' button if available.
Go to 'File' > 'Save As' and save the newly flattened document with a different filename to preserve your original editable copy.

Flatten PDF Annotations Quickly with WPS Office
Instead of using complex JavaScript codes, you can easily secure your PDF layouts or export them as image-based PDFs using WPS Office, ensuring your text boxes and annotations are completely secure and uneditable.
- 1. Open your PDF in WPS Office: Launch WPS Office, select the 'PDF' tab, and open the document containing the text boxes you want to flatten.
- 2. Access the Export Tools: Navigate to the 'Tools' tab on the top ribbon and select the 'Export to Picture' or 'PDF to Picture' option.
- 3. Configure output settings: In the pop-up dialog, choose to export as a 'Long picture' or multiple images, which inherently flattens all layers, text boxes, and annotations into a single visual layer.
- 4. Export and save: Click 'Export' to generate the secure image file, or use WPS PDF's built-in Print to PDF feature to create an uneditable, flattened version of your document.

Frequently Asked Questions
What does it mean to flatten a PDF?
Flattening a PDF takes separate, interactive elements—like form fields, annotations, text boxes, and digital signatures—and merges them into a single base layer. The document remains visually identical, but the elements lose their interactivity and editability.
Can I unflatten a PDF after saving it?
No, flattening is generally an irreversible process once the file has been saved and closed. If you think you might need to edit the text boxes later, you must keep an unflattened backup copy of your original document.
Why are my text boxes still editable when I just click 'Save'?
Using the standard 'Save' or 'Save As' functions in PDF editors preserves text boxes as interactive annotations. To permanently embed them so they cannot be edited, the file must be explicitly flattened using tools like JavaScript, preflight options, or by printing the document to a new PDF.
Does flattening a PDF reduce its file size?
It often can, depending on the document's contents. Flattening removes hidden layers, complex interactive form data, and metadata associated with annotations, which typically results in a smaller file size. However, if flattening involves rasterizing high-resolution elements, the size might increase.




