scsoil
asked on
Search and Bookmark Javascript for Acrobat
I need a Javascript to wok in Acrobat that will search through a searchable pdf documents for specific phrases and create a bookmark with the phrases name when if finds them.
This is a static lists of phrases eg. "PATIENT PROFILE", "COLONOSCOPY" ...
I will need to do this in a folder of approximately 1200 documents.
This is a static lists of phrases eg. "PATIENT PROFILE", "COLONOSCOPY" ...
I will need to do this in a folder of approximately 1200 documents.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
var root = this.bookmarkRoot;
var RegularExpression = new RegExp(/\n|\r|\t|\s/);
for (var i = 0; i < this.numPages; i++)
{
numWords = this.getPageNumWords(i);
var PageText = "";
var FoundSASID = 0;
for (var j = 0; j < numWords; j++) {
var word = this.getPageNthWord(i,j,fa
PageText += word;
var strMatches = PageText.match('SASID:');
if (strMatches != null) {
// Found text SASID: So reset the PageText to nothing and set the FOundSASID to 1
FoundSASID = 1;
PageText = "";
}
var newWord = PageText.match(RegularExpr
var foundSpace = PageText.match(' ');
if (newWord != null || foundSpace != null) {
if (FoundSASID==1) {
this.extractPages({nStart:
root.createChild(PageText,
FoundSASID = 0;
}
if (FoundSASID==0) {
PageText = "";
}
}
}
}