Anyway to programatically hide the bookmark icons

PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

on-board data systems
User
Posts: 4
Joined: Wed Aug 14, 2013 5:26 pm

Anyway to programatically hide the bookmark icons

Post by on-board data systems »

I can right click to hide them, but anyway to make them hide programatically?
Walter-Tracker Supp
User
Posts: 381
Joined: Mon Jun 13, 2011 5:10 pm

Re: Anyway to programatically hide the bookmark icons

Post by Walter-Tracker Supp »

There is a named command called "ToggleBookmarksPane" that will do what you want to do. You run commands by invoking the method DoVerb() of the ActiveX object. DoVerb() does a few things (see "Named Operations" in the manual), but for your purpose you will want to use it to invoke the operation called "ExecuteCommand", which then executes the named or numerical command passed as an argument. The table of commands is in the API manual and starts on page 84, section 2.2.2.2.1 (long section identifier, I know!).

To execute any of these commands, you can look up the numerical command ID in the table, and pass it to DoVerb().

The command to turn the bookmarks pane on and off is "ToggleBookmarksPane", ID 32910.

Example usage, in C++, would look something like this:

Code: Select all

CComBSTR bsOpName = L"ExecuteCommand";
CComVariant vDataIn = 32910; // cmd ID for ToggleBookmarksView; see named commands in manual
CComVariant vDataOut;
HRESULT hr = pViewer->DoVerb(NULL, bsOpName, vDataIn, &vDataOut, 0);
There is a demo application supplied with the SDK called "FullDemo", available in at least C# and C++, possibly a couple of the other supported languages. On the various tabs on this screen you can load documents, turn aspects of the UI on and off, execute named commands, etc. Referring to this demo (and perhaps tracing through the code / stepping through in debug mode) is a good way to figure out how to do things.

If you need more information don't hesitate to contact us here, or by email at support@pdf-xchange.com.

Thanks!

Walter
on-board data systems
User
Posts: 4
Joined: Wed Aug 14, 2013 5:26 pm

Re: Anyway to programatically hide the bookmark icons

Post by on-board data systems »

Tried it -- but it only works if the Bookmark window is already open, so I can't send it when opening the window the first time.

That brings to mind two questions --
1) How can I know that the Bookmark window is open?
2) And how can I know if Show Bookmark icons has been toggled?

For example, if I show the Bookmark window, and manually toggle it by mouse-right click and Show Bookmark icons, and then hide the bookmark window, and reopen it... I have no idea programatically if the bookmark icons are off or on.

Thanks for your help! Great product!
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17949
Joined: Mon Jan 12, 2009 8:07 am
Location: London

Re: Anyway to programatically hide the bookmark icons

Post by Tracker Supp-Stefan »

Hello on-board data systems,

To get and respectively set the visibility of the bookmarks pane you can use the following (in pseudocode):

Code: Select all

GetDocumentProperty(docId, "View.Panes["Bookmarks"].Visible", DataOut, 0);
SetDocumentProperty(docId, "View.Panes["Bookmarks"].Visible", DataIn, 0);
To get bookmark-icon visibility which is a document's property you will need:

Code: Select all

GetDocumentProperty(docId, "View.Bookmarks.ShowIcons", DataOut, 0);
OR access it as a global property (because it is synchronized with the document's property):

Code: Select all

GetProperty("Documents.LastView.Bookmarks.ShowIcons", DataOut, 0);
Regards,
Stefan