Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


Find text (NO whole words only) and Replace

New Here ,
Aug 08, 2020 Aug 08, 2020

Copy link to clipboard

Copied

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

Views

701

Likes

Translate

Translate

Report

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
Adobe Community Professional ,
Aug 09, 2020 Aug 09, 2020

Copy link to clipboard

Copied

It can only replace whole words.

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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?

Likes

Translate

Translate

Report

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
Adobe Community Professional ,
May 05, 2021 May 05, 2021

Copy link to clipboard

Copied

LATEST

You can ask Adobe. 

Likes

Translate

Translate

Report

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
Adobe Community Professional ,
Aug 09, 2020 Aug 09, 2020

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

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
Adobe Community Professional ,
Aug 09, 2020 Aug 09, 2020

Copy link to clipboard

Copied

The OP want replace text in the document.

Likes

Translate

Translate

Report

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