Extracting PDF content based on bookmarks

Q: I need to be able to extract certain pages from a pdf into a new
pdf based on the
bookmark. I cannot find how to determine what page a bookmark points
to.
How can I determine what page a bookmark points to?
------
A: You may want to refer to Bookmark sample project
(http://www.pdftron.com/net/samplecode.html#Bookmark).

Bookmark item = ...
Action action = item.GetAction();
if (action.IsValid()) {
  if (action.GetType() == Action.Type.e_GoTo) {
     Destination dest = action.GetDest();
     if (dest.IsValid()) {
       Page page = dest.GetPage();
       int page_num = page.GetIndex());
....

You will also find some relevant sample in this forum - Search for
"split by bookmarks". The first article talks about how to split a PDF
based on bookmarks.

Q: I had looked at that sample and could not get it to work. I need to
be able to open a pdf, find a bookmark by name, and then split out
whatever page it is on all the way to the next bookmark.
-----
A: Based on your requirements you should be able to tweak the sample
code from the Knowledge Base to implement 'split by bookmarks'. You
can search for a given bookmark by name using
bookmark_item.GetTitle(). To find a bookmark node, you may need to
traverse 'children' items of a parent bookmark (as in Bookmarks sample
project). After you find the bookmark item to split on, you can obtain
the next bookmark by traversing the outline tree (as in Bookmarks
sample project).

You may also want to try using PDF PageMaster (www.pdftron.com/
downloads/pagemaster_sdk.zip) which is a simple command-line
application built on top of PDFNet SDK. PageMaster includes built-in
functionality to split by bookmarks (for example, "pagemaster -s --
bybookmarks 1,3 in.pdf").