Hello Tracker Support Team,
I am trying to read Bookmarks from PDF and retrieving its Page-Number.
To retrieve the Page-Number right now, i am using a workaround to include the page-number in the title of the bookmark. Because the Bookmark-Title is acessible from the IPXC_Bookmark object.
The Bookmarks look like this:
Page:1 Title
Page:5 Title2
Page:10 Title3
Sample Code below:
var pxcInst = (PDFXEdit.IPXC_Inst)m_PdfInst.GetExtension("PXC");
m_Document = pxcInst.OpenDocumentFromFile(@"PathToSampleDocument", null);
uint ct = 0;
IPXC_Bookmark bookmark;
while (ct < m_Document.BookmarkRoot.ChildrenCount)
{
if (ct == 0)
bookmark = m_Document.BookmarkRoot.FirstChild;
else
bookmark = m_Document.BookmarkRoot.Next;
retrievePageNumberFromTitle(bookmark.Title);
ct++;
}
Background:
I want to split a self created PDF-Document with Bookmarks, the PageNumber of the Bookmarks can be different depending on the size of the Pdf-File. In the example above i would define the PagesRange like this:
"1-4,5-9,10-Pages.Count"
Giving me 3 Documents depending on the Bookmarks.
It's working using the workaround, but i am wondering if there is a method to retrieve the Page-Number directly from the IPXC_Bookmark object. And i don't have to use the Bookmark Title as a workaround.
Thanks in Advance
Rudi
Retrieve Page from IPXC Bookmark in Pdf Document
Moderators: TrackerSupp-Daniel, Tracker Support, Sean - Tracker, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Ivan - Tracker Software, Tracker Supp-Stefan
Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.
When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.
When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
-
- User
- Posts: 1325
- Joined: Thu Sep 05, 2019 12:35 pm
Re: Retrieve Page from IPXC Bookmark in Pdf Document
Hi Rudi,
A bookmark can have actions or not. If not, when you click it - nothing happens.
https://sdkhelp.tracker-software.com/vi ... rk_Actions
If there are actions assigned, those actions can do various things.
https://sdkhelp.tracker-software.com/vi ... ctionsList
https://sdkhelp.tracker-software.com/vi ... sList_Item
https://sdkhelp.tracker-software.com/vi ... PXC_Action
https://sdkhelp.tracker-software.com/vi ... ction_Type
A type of an action can be "Go to a page in the same document" - this is probably the one you are talking about.
If it is, then https://sdkhelp.tracker-software.com/vi ... ction_Goto and https://sdkhelp.tracker-software.com/vi ... _Goto_Dest and https://sdkhelp.tracker-software.com/vi ... estination "nPageNum" gives you the target page.
p.s.
For how to check the type of an action and how to cast the action to its type and get the destination: search this forum ...
-žarko
A bookmark can have actions or not. If not, when you click it - nothing happens.
https://sdkhelp.tracker-software.com/vi ... rk_Actions
If there are actions assigned, those actions can do various things.
https://sdkhelp.tracker-software.com/vi ... ctionsList
https://sdkhelp.tracker-software.com/vi ... sList_Item
https://sdkhelp.tracker-software.com/vi ... PXC_Action
https://sdkhelp.tracker-software.com/vi ... ction_Type
A type of an action can be "Go to a page in the same document" - this is probably the one you are talking about.
If it is, then https://sdkhelp.tracker-software.com/vi ... ction_Goto and https://sdkhelp.tracker-software.com/vi ... _Goto_Dest and https://sdkhelp.tracker-software.com/vi ... estination "nPageNum" gives you the target page.
p.s.
For how to check the type of an action and how to cast the action to its type and get the destination: search this forum ...
-žarko
- Tracker Supp-Stefan
- Site Admin
- Posts: 16747
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
- Contact:
Re: Retrieve Page from IPXC Bookmark in Pdf Document
Hello zarkogajic,
Many thanks for the above post and detailed help!
@RudiRo - please do let us know if the above helped!
Kind regards,
Stefan
Many thanks for the above post and detailed help!
@RudiRo - please do let us know if the above helped!
Kind regards,
Stefan