Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
1

Find text (NO whole words only) and Replace

New Here ,
Aug 08, 2020 Aug 08, 2020

I need to find a text (NO whole words only) and replace it with another in Acrobat Pro. Is there any reason why the "whole words only" option is forcibly selected and grayed out?

 

Screen Shot 2020-08-08 at 11.51.12 PM.png

TOPICS
Edit and convert PDFs
3.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 09, 2020 Aug 09, 2020

It can only replace whole words.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 05, 2021 May 05, 2021
quote

It can only replace whole words.


By @Bernd Alheit

I want to point out how absolutely idiotic that is.

Good gods, do they really not comprehend that we are going to inevitably want to search and replace substrings?

Why even impose this kind of nonsensical restriction in the first place?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 05, 2021 May 05, 2021

You can ask Adobe. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 09, 2020 Aug 09, 2020

This may be achieved with javascript though.

 

Here's a Band-Aid remedy(not elegant, not perfect but useful):

 

 

for (var p = 0; p < this.numPages; p++)
{
var numWords = this.getPageNumWords(p);
for (var i=0; i<numWords; i++)
{
var ckWord = this.getPageNthWord(p, i, true);
if ( ckWord == "Acrobat")
{
var q = this.getPageNthWordQuads(p, i);
// Convert quads in default user space to rotated
// User space used by Links.
m = (new Matrix2D).fromRotated(this,p);
mInv = m.invert()
r = mInv.transform(q)
r=r.toString()
r = r.split(",");
l = addLink(p, [r[4], r[5], r[2], r[3]]);
l.borderColor = color.red;
l.borderWidth = 1;
l.setAction("this.getURL('http://www.example.com/')");
}
}
}

 

 

Note that the script above creates a red rectangle around the word(s) found. It also converts them to a hyperlink, but you  can modify the script to whatever way you need to behave.

 

This script example is referenced in the Adobe Acrobat SDK JavaScript API Reference,  "Doc methods",  Example 2, Page 232

 

This is an action than can be employed as a mouse-up action or as bacth using the Acrobat's built-in Action Wizard tool.

 

See slides:

 

ckWord.png

 

You can reuse this action as many times as you need it. To perform a different search each time  just change the string of text inside the quotes in the line shown below:

 

if ( ckWord == "Acrobat")

 

 

ckWord2.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 09, 2020 Aug 09, 2020

The OP want replace text in the document.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 19, 2024 Mar 19, 2024
LATEST

I came across the same problem and accidentally found that I had to clear out the search and replace fields and close the edit PDF window. When I did a new search or search and replace, the Whole Words Only option was unselected.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines