Pretty much, I want to search the pdf for bookmark names. If the name is matched then the form will display that it is included or missing in the file.
Used bookmark search through tutorial here.
Thanks in advance for the help :)
var inc = "Included";
var mis = "Missing";
var note = this.getField("TextField1");
function searchBookmarks(bkm, nLevel, bkmName)
{
if ( bkm.name == bkmName ) return bkm;
if (bkm.children != null) {
for (var i = 0; i < bkm.children.length; i++)
{
var bkMark = searchBookmarks(
bkm.children[i], nLevel + 1, bkmName);
if ( bkMark != null ) break;
}
return bkMark;
}
return null;
}
var bkmName = /\Wnote\W/;
var bkm = searchBookmarks(this.bookmarkRoot, 0, bkmName );
if ( bkm != null ) {note.value=inc;}
else {
note.value=mis;
}
(bkmName = "note"; works but I want to use an expression to find variations because of how different users type.)
It's not clear to me whether the regular expression you have is sufficient for what you want to do though. If searching for "note", do you also want to accept "Note" and "NOTE"? Would anything else be accepted?