The deleting is not work with the method “OutlineItemCollection.Delete()”. And I don’t want to delete bookmark with “OutlineItemCollection.delete(name)”, because the bookmarks may have the same title name sometimes. is there any way to solve this problem?
var doc = new Aspose.Pdf.Document();
doc.Pages.Insert(1);
// Create parent bookmark1
var bookmark1 = new OutlineItemCollection(doc.Outlines);
bookmark1.Title = "Bookmark1";
doc.Outlines.Add(bookmark1);
// Create child bookmark2
var bookmark2 = new OutlineItemCollection(doc.Outlines);
bookmark2.Title = "Bookmark2";
bookmark1.Add(bookmark2);
var bookmark3 = new OutlineItemCollection(doc.Outlines);
bookmark3.Title = "Bookmark3";
bookmark3.Action = new GoToAction(1);
bookmark1.Add(bookmark3);
doc.Save("test.pdf");
// Delete the bookmark2
bookmark2.Delete();
doc.Save("test.pdf");
// The "bookmark2" still exists in the pdf document