How do I remove invalidated bookmarks when a page is deleted from the PDF?

Q: I know that with PDFDoc.ImportPages(..., true) I can import pages
along with bookmarks associated with the page. However, I cannot find
a method that gets rid of bookmarks that are associated to a page that
is removed. For example, something along the line of
PDFDoc.PageRemove(..., true). Where true, would allow the removal of
the bookmarks.

Is there a method that removes bookmarks when a page is removed?
A: At the moment there is no method that automatically removes
invalidated bookmarks, however this functionlity can be fairly easy to
implement using the current API:

- Before removing the page you can traverse the bookmark tree (similar
to PrintOutlineTree in Bookmark sample -

- If the 'GoTo' action points to the page that you wish to remove
either modify the goto action, remove the action, or remove the
bookmark node.

- Remove the page using PDFDoc.PageRemove(...)