I think the way to do it is by creating a new PDDocumentOutline object and copy into it just those children then you want to keep, and then apply it to the Document Catalog.
On Tue, Oct 27, 2020 at 3:14 PM Sarah Kasery <[email protected]> wrote: > Dear pdfbox user group, > > I'm really scratching my head on the following issue I'm facing : > Here is the bookmarks of my document > root > - child > - child > secondroot > - secondchild > - secondchild > > I'm able to get all the bookmarks of my document with the > getDocumentOutline() function. But now I would like to delete the > secondroot bookmark and also its descendant. > > In the end, I would like to have the following : > root > - child > - child > > Is there a way to achieve this ? During testing I always end up getting the > IllegalArgumentException because my node is still part of a list. > > Thank you in advance for your help and kind regards, > Sarah >

