You can do that with a number of tools. iTextPdfSharp will likely be able to do it. It will amount to opening the document and walking the tree in the catalog that has the bookmarks in it. Their code works fine, but be sure to download the spec so you can understand the structure of the tree. I worked the original version of Acrobat and many of my fellow engineers engineers felt that the bookmark tree was a little over-complicated.
BitMiracle offers similar code. They routinely patrol Stack Overflow, so you might see an answer from them too (HI!) - you can see a sample of their work here for authoring bookmarks.
If you're willing to pay money, this is easy using Atalasoft's DotPdf (disclaimer: I work for Atalasoft and wrote nearly all of DotPdf). In our API, we try to hide the complexity of the structure where possible (for example, if you want to iterate of the chain of chains of actions taken when a bookmark is clicked, it's a foreach instead of a tree walk) and we've wrapped the bookmark tree into standard List<T>
collections.
public void WalkBookmarks(Stream pdf)
{
// open the doc
PdfDocument doc = new PdfDocument(pdf);
if (doc.BookmarkTree != null)
{
// walk the list of top level bookmarks
WalkBookmarks(doc.BookmarkTree.Bookmarks, 0);
}
}
public void WalkBookmarks(PdfBookmarkList list, int depth)
{
if (list == null) return;
foreach (PdfBookmark bookmark in list)
{
// indent to the depth of the list and write the Text
// you can also get the color, basic font styling and
// the action associated with the bookmark
for (i = 0; i < depth; i++) Console.Write(" ");
Console.Writeline(bookmark.Text);
// recurse on any children
WalkBookmarks(bookmark.Children, depth + 1);
}
}