PDF Editing Issues

How to Unlock Acrobat Comment Text Tools Using JavaScript

Muhammad TalhaMuhammad Talha Oct 28, 2026 869 views

Question details

The user needs a method to unlock text commenting tools or annotations in Adobe Acrobat so they can be freely edited.

How to Unlock Acrobat Comment Text Tools Using JavaScript
Product
Adobe Acrobat
Device & OS
Windows / macOS
Scenario
Reviewing or editing a PDF document where the author has restricted modifications to text comments and annotations.
Observed behavior
The commenting text tool is locked, preventing the user from moving, modifying, or deleting the selected text annotations.
Before you start

Ensure you have the necessary document permissions to modify the PDF file, and verify that JavaScript execution is enabled in your Adobe Acrobat preferences.

Solution 1Recommended

Use the Acrobat JavaScript Console to Batch Unlock

Execute a short script via the JavaScript console to instantly remove the lock and read-only status from all annotations in the PDF.

This method is highly efficient if a document contains multiple locked text comments, as it uses an automated script to loop through and unlock every annotation on the page.

1
Open the JavaScript Console

Press Ctrl + J on Windows or Command + J on macOS to open the interactive JavaScript debugger console in Adobe Acrobat.

2
Input the Unlock Script

Click into the console input area and paste the following script: syncAnnotScan(); var annots = getAnnots(); for (var i = 0; i < annots.length; i++) { annots[i].lock = false; annots[i].readOnly = false; }

3
Execute the Command

Highlight the entire block of code you just pasted, then press Ctrl + Enter on Windows (or Command + Return on macOS) to execute the script.

Use the Acrobat JavaScript Console to Batch Unlock
Annotations Unlocked: The console will return 'undefined' or a script success confirmation. You can now close the console and click on any previously locked text tool to edit it freely.
Free Microsoft Office alternative

Manage PDF Comments Effortlessly with WPS Office

If dealing with scripts and locked interfaces in Acrobat is slowing you down, try WPS Office. It provides an intuitive, lightweight PDF editor that makes adding, editing, and managing comments completely hassle-free without the need for complex workarounds.

  1. 1. Open your PDF in WPS: Launch WPS Office and open your PDF document. The software automatically recognizes existing text tools and annotations.
  2. 2. Navigate to the Comment Tab: Click on the 'Comment' tab on the top ribbon to access the full suite of annotation and text editing tools.
  3. 3. Edit Comments Directly: Click on any text comment to instantly modify, move, or delete it using the intuitive properties panel on the right.
Easily manage, unlock, and edit PDF comments via a user-friendly interface instead of using code.Fully compatible with standard PDF formats as well as Microsoft Office files (Word, Excel, PowerPoint).Lightweight application that uses minimal system resources while maintaining fast processing speeds.Completely free to download with a familiar UI that makes migrating from other software seamless.
QA img-9

Frequently Asked Questions

Can I unlock a single PDF comment without using JavaScript?

Yes. If the document isn't globally restricted by a password, you can right-click the specific comment, choose 'Properties', and uncheck the 'Locked' option at the bottom of the dialog box.

Why are my PDF comments locked by default?

Comments are often locked by the original document author to prevent accidental changes, deletions, or shifts in formatting during the document review process.

What should I do if the JavaScript console is disabled in Acrobat?

If your security settings prevent the console from opening, navigate to Edit > Preferences > JavaScript and ensure the 'Enable Acrobat JavaScript' checkbox is selected before trying again.

Does this JavaScript remove password protection from the whole PDF?

No. This script only alters the 'lock' and 'readOnly' properties of existing annotations (like text boxes and sticky notes). It cannot bypass document-level encryption or owner passwords.