Customizing the toolbar: is the solution future proof?

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

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

haviital
User
Posts: 11
Joined: Mon Oct 07, 2013 11:23 am

Customizing the toolbar: is the solution future proof?

Post by haviital »

Hi,

We would like to show only one toolbar in the integrated PDF XChange ActiveX view in our application. That is the "Comment And Markup" toolbar, which contain annotation tools. In addition, we need to add "Save As" command to the toolbar. As the ActiveX API supports only putting the existing commands in the toolbar to offline or online, that cannot be made via the API. The only way to do it (that I have figured out) is to add the new command to the toolbar via customizing the UI on the view, and save the settings to registry. Then load the settings from the registry every time the view is created. That seems to work fine.

My concern is that there are a huge number of different keys and values in the registry after saving the settings. We are planning to deploy the same settings for our clients all over the world, and our application is used in many different environments.

1) Are there any settings that are somehow running environment dependent, like Windows version, locale, language, screen size, etc? That would prevent using the one common settings for all.

2) Is it viable to use only partial settings when using LoadSettings()? I have experimented with the settings in registry and noticed that I can remove all other keys except "General" and "View/Bars/007" and LoadSettings() still works: the "Save As" command is added to the "Comment And Markup" toolbar. If that is a recommended way to do it, it would minimize the problems in the bullet 1). But again, is this future proof: does it work like this in the future versions of PDFXChange?

Br,
Hannu Viitala
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2445
Joined: Thu Jun 30, 2005 4:11 pm

Re: Customizing the toolbar: is the solution future proof?

Post by Vasyl - PDF-XChange »

Hi Hannu Viitala.

You may use a settings file instead of the system registry to keep/restore all application's options and toolbars customization. For this:

Code: Select all

YourForm::OnBeforeClose()
{
   oleVariant dst("C:\PDFViewer.Settings.dat");
   pdfViewer.SaveSettings(dst);
}

YourForm::OnAfterCreate()
{
   oleVariant src("C:\PDFViewer.Settings.dat");
   pdfViewer.LoadSettings(src);
}
1) Are there any settings that are somehow running environment dependent, like Windows version, locale, language, screen size, etc? That would prevent using the one common settings for all.
Yes, one is - the setting for the UI-language. To prevent auto-detection of the UI-language by the system's regional settings use:

Code: Select all

pdfViewer.SetProperty("International.LocaleID", 0x040b, 0); // 'Finnish' UI-language, for other supported values look to ./Languages/*.xml, "lcid" attribute...
2) Is it viable to use only partial settings when using LoadSettings()? If that is a recommended way to do it, it woulI have experimented with the settings in registry and noticed that I can remove all other keys except "General" and "View/Bars/007" and LoadSettings() still works: the "Save As" command is added to the "Comment And Markup" toolbar.d minimize the problems in the bullet 1). But again, is this future proof: does it work like this in the future versions of PDFXChange?
No, sorry no standard way for that. However, if you stored all settings into the registry then you may remove from the saved registry data some unnecessary keys/values (to revert to the default on next loading). It is possible, but not recommended in all cases, because some options can be related and uncontrolled deletion any of them may cause problems.

In most cases it is normal way but.. If you found a solution that is working correctly for you - don't worry and use it because we are not planning to change anything in this SDK - only bug-fixes will be offered as the next 'Major' release incorporating significant changes offered to Developers as an SDK will be the 'Editor' SDK itself - though this is still in the early stages of release preparation with much to do on Documentation and Examples .....

Best
Regards.
PDF-XChange Co. LTD (Project Developer)

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
haviital
User
Posts: 11
Joined: Mon Oct 07, 2013 11:23 am

Re: Customizing the toolbar: is the solution future proof?

Post by haviital »

Ok, then we go forward with selected registry settings

Thanks,
Hannu
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19868
Joined: Mon Jan 12, 2009 8:07 am

Re: Customizing the toolbar: is the solution future proof?

Post by Stefan - PDF-XChange »

:)