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
Post a Comment