Highlighted

Find text (NO whole words only) and Replace

New Here ,
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

84

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

Find text (NO whole words only) and Replace

New Here ,
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

85

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
Aug 08, 2020 0
Adobe Community Professional ,
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
Reply
Loading...
Aug 09, 2020 0
Adobe Community Professional ,
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
Reply
Loading...
Aug 09, 2020 0
Adobe Community Professional ,
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
Reply
Loading...
Aug 09, 2020 0