How to delete unused bookmarks from a PDF?


i trying find way automatically delete bookmarks pdf if attached "named destination" no longer exists in document.

 

i thought loop through bookmarks, execute them, , of threw error bookmark deleted didn't work ie. no exception thrown. here code:

 

var mybookmarks = this.bookmarkroot.children;

for (var i=0; i<mybookmarks.length; i++)

try

{

mybookmarks[i] = mybookmarks[i].execute();

}

catch (myerror)

{

mybookmarks[i] = mybookmarks[i].remove();

}

 

 

does have ideas how this??? many thanks. hj

at beginning of loop, set current view know not destination of bookmark (e.g., page = 0, zoom = 1234), execute bookmark, , if view different, indication bookmark valid.



More discussions in JavaScript


adobe

Comments

Popular posts from this blog

How to set the order of FAQs instead of alphabetical

Thread: Get UK Keyboard working

how do I change the e-mail address for my merchant account