Question
Trying to write a code to create bookmarked on all highlighted values in a document
I've gone through and highlighted a lot of values in a pdf using the "Find, Highlight, and Extract" tool, and now I'm trying to make a bookmark at each highlighted value. I'm trying to work something out but I keep getting errors. Any help would be greatly appreciated!
var valuesToFind = ["1", "2"];
for (var i = 0; i < valuesToFind.length; i++) {
this.syncAnnotScan();
var results = this.search(valuesToFind[i], true, true);
for (var j = 0; j < results.length; j++) {
var result = results[j];
var bookmark = this.addAnnot({
type: "Bookmark",
page: result.page,
rect: result.rect,
name: valuesToFind[i]
});
}
}
