Frequently Asked Question:
How can I split pages by bookmarks?
How can I split pages by bookmarks?
Splitting pages by bookmarks is easy if each of your bookmarks corresponds with a sorted descending page range. The way to do this is to simply take bookmark 1 and get it's page reference and then get bookmark 2 and it's page reference and then use the ExtractPages function to extract the pages from the start of bookmark 1 to the end of bookmark 1, which is the page before the start of bookmark 2.
Consider this scenario:
Bookmark 1, page 1 Bookmark 2, page 5 Bookmark 3, page 7 Bookmark 4, page 15
In this scenario you would extract the pages from 1 to 4 for bookmark 1, pages 5 to 6 for bookmark 2, pages 7 to 14 for bookmark 3 and so on.
The page number for the StartPage and the PageCount would be variable and would be determined on the fly by using the GetOutlinePage function
(The technical term for bookmarks is outlines.)