Quantcast
Channel: Adobe Community : Popular Discussions - JavaScript
Viewing all articles
Browse latest Browse all 12130

Action that finds specified words and highlight the whole sentence or paragraph

$
0
0

Hi All,

 

I know a action file from Acrobat users group (http://acrobatusers.com/content/find-highlight-words-and-phrases) which find and highlight a set of words using Acrobat action. But, is this possible to modify the javascript to select and highlight the "whole sentence" of the word selected? I have no knowledge about javascript, but hope I can learn how to search a word and grab the sentence or even the paragraph that a selected word appears in!

 

Thanks a lot for all your help.

 

I copied the said javascript in below:

 

/ Highlight Color

var colHilite = color.yellow;

var oDoc = event.target;

 

 

var aAnnts = oDoc.getAnnots({sortBy:"Author"});

for(var i=0;i<aAnnts.length;i++)

{

   if(aAnnts[i].type == "Redact")

   {

      aAnnts[i].type = "Highlight";

      aAnnts[i].strokeColor = colHilite;

   }

}


Viewing all articles
Browse latest Browse all 12130

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>