How to Automate Add Note to Replace Text in Adobe Acrobat
Question details
The user wants to know if they can automate the process of finding specific text in a PDF and automatically adding a 'Replace Text' comment with the new content using Adobe Acrobat.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Reviewing or editing a PDF document where repetitive text replacement comments need to be added automatically based on specific search terms.
- Observed behavior
- Adobe Acrobat does not have a native built-in script command to directly automate replacing page text or directly generating 'Replace Text' annotations based on a text search.
Remember that PDF is primarily a publishing format rather than a word processing format. For extensive or permanent text changes, verify if you have access to the original source document before attempting script-based workarounds.
Use Search and Redact with a Custom Script
Since Acrobat cannot directly replace text with a standard script, you can use the Redaction tool to mark text, then run a JavaScript to convert these marks into Replace Text comments.
This method acts as a workaround by leveraging the built-in search capabilities of the Redaction tool. Instead of applying the redaction, a custom script is used to read the redaction coordinates and generate a text replacement annotation.
In Adobe Acrobat, go to the 'Tools' menu, select 'Redact', and click on 'Search and Remove Text'.
Enter the specific letters or words you want to replace and search the document.
Select the found instances and choose to mark them for redaction. Do not apply or finalize the redaction.
Open the JavaScript console (Ctrl+J or Cmd+J) and execute a custom script designed to loop through the redaction annotations and convert them into 'Replace Text' comments containing your desired replacement text.
Edit the Original Source Document
The most reliable way to handle bulk text replacement is to modify the source file before it becomes a PDF.
Easily Find and Replace Text in PDFs with WPS Office
Instead of relying on complex scripts and workaround comments, WPS PDF allows you to directly edit and replace text in your PDF documents just like a word processor, making document updates quick and hassle-free.
- 1. Open your PDF file: Launch WPS Office and open the PDF document you need to modify.
- 2. Access the Edit tab: Navigate to the 'Edit' tab located on the top toolbar.
- 3. Enable text editing: Click on 'Edit Content' or 'Edit Text' to make the document's text blocks editable.
- 4. Find the target text: Press Ctrl+F to find the specific text, or click directly into the text box containing the words you want to replace.
- 5. Replace and save: Highlight the existing text, type your new replacement text, and save the updated PDF document.

Frequently Asked Questions
Can Acrobat JavaScript directly replace text on a PDF page?
No, Acrobat scripts cannot directly edit or replace underlying page text. PDF is fundamentally a presentation format, so standard scripts are generally limited to interacting with form fields, annotations, bookmarks, and page properties rather than the core text elements.
Why is it better to edit the source document instead of replacing text in the PDF?
PDF files do not retain the text flow, paragraph structure, or styling logic of a standard word processor. Modifying the original document ensures formatting remains intact, paragraphs reflow correctly, and prevents layout overlapping.
How do I add a Replace Text comment manually in Acrobat?
Select the text you want to replace using the Selection tool, right-click the highlighted text, and choose 'Add Note to Replace Text'. A strikeout line will appear over the original text along with a comment box where you can type your replacement text.




