Question
Get the Bookmark Object of a Clicked Bookmark by Javascript
I want to make bookmarks as bellow using Javascript.
- Each bookmark has a same name as each layers in pdf.
- Each bookmark has the following action.
When the bookmark is clicked, the only layer with same name as the bookmark will be displayed.
----------------------------------------------
var layers = this.getOCGs();
for (var j in layers){
this.bookmarkRoot.createChild(layers[j].name, "xxxxxx");
}
----------------------------------------------
I want to enter the following script into "xxxxxx". (cExpr augument of createChild method)
----------------------------------------------
var layers = this.getOCGs();
for (var i in layers){
if (layers[i].name === bookmark.name){
layers[i].state = true;
}
else{
layers[i].state = false;
}
}
----------------------------------------------
This script expression is evaluated when the bookmark is clicked
But I can't find how to get the bookmark Object that is being clicked now...
Please give me an advice.
