Copy link to clipboard
Copied
Hi, please, i need to delete all child bookmarks, can you share a working javascript script that can do that please?
thanks
You can use this code to do it:
if (this.bookmarkRoot.children!=null) {
for (var i=0; i<this.bookmarkRoot.children.length; i++) {
var bkm = this.bookmarkRoot.children[i];
if (bkm.children!=null) {
for (var j=bkm.children.length-1; j>=0; j--) {
bkm.children[j].remove();
}
}
}
}
Copy link to clipboard
Copied
You can use this code to do it:
if (this.bookmarkRoot.children!=null) {
for (var i=0; i<this.bookmarkRoot.children.length; i++) {
var bkm = this.bookmarkRoot.children[i];
if (bkm.children!=null) {
for (var j=bkm.children.length-1; j>=0; j--) {
bkm.children[j].remove();
}
}
}
}
Copy link to clipboard
Copied
thank you sir, you are the best. Please, how can i know what variables do i need to use, where can i see that please? (bookmarRoot, etc.)
Copy link to clipboard
Copied
It's all in the JS for Acrobat API Reference, which is a part of the Acrobat SDK, available here: http://www.adobe.com/devnet/acrobat.html