store ekstra information in a bookmark

PDF-XChange Editor SDK for Developers

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, 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.
Post Reply
jusWest
User
Posts: 150
Joined: Fri Aug 24, 2018 8:26 am

store ekstra information in a bookmark

Post by jusWest »

Hello!

We are evaluating the editor sdk for a new product we are developing.

In this product we are generating the boomarks as a tree manually, an it works as intended, but in our application
we would like to store more information in each bookmark node. Is there something like a Tag property we can
store information in? Or is there a way to extend the bookmark object with extra properties?

We are using C#.

Regards
Ronny
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: store ekstra information in a bookmark

Post by Sasha - Tracker Dev Team »

Hello Ronny,

We do not have a direct property or method to do things like this, though overall this is possible.
There are several ways that this can be achieved:
1) You will have to get each bookmark's PDFObject (Structure document level) and place custom nodes inside of it. When the document is saved, these custom nodes will be written with the overall bookmarks dictionary. Then when opening this document, you will have to get to the bookmark's PDFObject again and get your custom data.
This method has a flaw, that some operations can replace the bookmarks in such a way that these custom nodes will be cleaned (Import\Export but I'm not sure).
2) You can create your custom IPXC_Action and place it inside the bookmarks. There you can store all of the data that you need. For this you will have to create your own IPXC_ActionHandler derived class and implement the needed methods. With this method, there is much less document structure manipulation then the previous method, though again you will have to create the interface implementation.
3) You can create a separate list in the Root dictionary, where you will store the needed data with the references to the bookmarks' PDFObjects. Then if you need to find the data for the IPXC_Bookmark, you will take it's PDFObject and search through your list for the needed data. This method does not have the flaw that the first method has - your data won't be accidentally cleaned when some bookmark procedure that does this occur. This dictionary will be saved with the document.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
jusWest
User
Posts: 150
Joined: Fri Aug 24, 2018 8:26 am

Re: store ekstra information in a bookmark

Post by jusWest »

Thank you for your response.

I think maybe option 3 seems like a good choice.

Do you have an exampe of how this is done?

/Ronny
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: store ekstra information in a bookmark

Post by Sasha - Tracker Dev Team »

Hello Ronny,

Just uploaded new version of the CoreAPIDemo with the sample included (14.1.):
https://github.com/tracker-software/PDFCoreSDKExamples
Here's a result that you will get by executing it:
Capture44.PNG
I suggest you to download some PDF Structure viewer to see what you are doing.
You can do all of this in the Editor SDK, as the CoreAPI is only a part of it. But for illustration purposes it was better to put it there.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
jusWest
User
Posts: 150
Joined: Fri Aug 24, 2018 8:26 am

Re: store ekstra information in a bookmark

Post by jusWest »

Thanks, I will check it out :)
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: store ekstra information in a bookmark

Post by Sasha - Tracker Dev Team »

:)
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
jusWest
User
Posts: 150
Joined: Fri Aug 24, 2018 8:26 am

Re: store ekstra information in a bookmark

Post by jusWest »

another question somehow related to this.

Given two bookmarks and their goto actions, can one derive the number of pages between theese two bookmarks?

Regards
Ronny
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: store ekstra information in a bookmark

Post by Sasha - Tracker Dev Team »

Hello Ronny,

If I understood you correctly - you can use the Named Destinations for that.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
jusWest
User
Posts: 150
Joined: Fri Aug 24, 2018 8:26 am

Re: store ekstra information in a bookmark

Post by jusWest »

ok, do you have an example of using Named Destinations?
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: store ekstra information in a bookmark

Post by Sasha - Tracker Dev Team »

Hello Ronny,

Do you have the basic understanding what they are and how they are used? Also, have you tried doing the same in the End-User Editor?

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply