Restrict color selection for comment and markup tools

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

User avatar
MartinCS
User
Posts: 153
Joined: Thu Apr 07, 2011 10:01 am

Restrict color selection for comment and markup tools

Post by MartinCS »

Hi,

is it possible to limit the available color selection for a tool, e.g. rectangle tool, to the following options:

*) no fill
*) one custom color -> set with: AxCoPDFXCview1.SetProperty("Commenting.Rect.Styles[0].SColor", RGB_val, 0)

The user should not be able to set any additional custom color or 'More colors...'. (Please see attachment.)

I know it is possible to lock the fill color tool using 'Commands[0].State = Offline' using the 'SetProperty' method. But the user should still be able to set the filling color for the selected tool, e.g. rectangle tool, if necessary.


Thank you,
Martin
You do not have the required permissions to view the files attached to this post.
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2445
Joined: Thu Jun 30, 2005 4:11 pm

Re: Restrict color selection for comment and markup tools

Post by Vasyl - PDF-XChange »

Hi, MartinCS
is it possible to limit the available color selection for a tool, e.g. rectangle tool, to the following options:
*) no fill
*) one custom color -> set with: AxCoPDFXCview1.SetProperty("Commenting.Rect.Styles[0].SColor", RGB_val, 0)
In current implementation you may disable for end-user the color-selector control only by:

Code: Select all

ctrl.SetProperty("Commands[#36273].State", "offline", 0); // to disable "Fill Color" color-selector,
// and if you need:
ctrl.SetProperty("Commands[#36274].State", "offline", 0); // to disable "Stroke Color" color-selector,
- and in your app. you may implement two buttons "Select_NoColor" and "Select_TheCustomColor"...

HTH
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.
User avatar
MartinCS
User
Posts: 153
Joined: Thu Apr 07, 2011 10:01 am

Re: Restrict color selection for comment and markup tools

Post by MartinCS »

Hi Vasyl,

thank you for your reply. Is it possible to set these two custom buttons using the toolbar of the viewer. My idea would be to add a custom toolbar with the both buttons you suggested.

Thank you!


Regards,
Martin
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19885
Joined: Mon Jan 12, 2009 8:07 am

Re: Restrict color selection for comment and markup tools

Post by Stefan - PDF-XChange »

Hello Martin,

You can not add custom buttons in a toolbar inside our Viewer, so they will need to be in the main body of your application.

Best,
Stefan