Re-Order Pages to Match Bookmarks
Hello,
I am writing a C++ Acrobat plug-in and I am new to the Acrobat SDK.
What my plug-in currently does: Recursively iterates through all bookmarks, starting at the root, and gets the title for each bookmark.
My goal: Determine the page number associated with each bookmark (if there is one) and then re-order all the pages in the document according to the order of the bookmarks.
My problem: After reading through the Acrobat SDK, I cannot find a way to determine the page number for a given bookmark. So far I have tried:
// get the action for the current bookmark
PDAction bookmarkAction = PDBookmarkGetAction(aBookmark);
// get the view destination for the current bookmark's action
PDViewDestination bookmarkViewDestination = PDActionGetDest(bookmarkAction);
Am I headed down the right path? Does the PDViewDestination contain some other object that will give me the page number for this bookmark? Or at least let me determine if there is a page number for the bookmark?
Or maybe I need to actually "go to" each bookmark destination. Then, once I have programmatically "clicked" on the bookmark, I could determine what page the bookmark was pointing at by checking the page number of the active document. I have tried the following code, but it doesn't actually move the document to a different page like I expected it to:
// open the current bookmark
PDBookmarkSetOpen(aBookmark, true);
Thank you in advance for any help you're able to provide. I'm still very new to the Acrobat SDK and I look forward to learning more.
