setting text color of typewriter tool

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

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

setting text color of typewriter tool

Post by MartinCS »

Hi,

we are trying to set the font color of the typewriter tool programmatically using the following code:

Code: Select all

Call g_oPdfViewer.SetProperty("Commenting.Typewriter.Styles[0].TextFormat.Char.FontSize", 20, 0)
Call g_oPdfViewer.SetProperty("Commenting.Typewriter.Styles[0].TextFormat.Char.FontName", "Arial", 0)
Call g_oPdfViewer.SetProperty("Commenting.Typewriter.Styles[0].TextFormat.Char.Bold", 1, 0)
Call g_oPdfViewer.SetProperty("Commenting.Typewriter.Styles[0].TextFormat.Char.Strikeout", 1, 0)
Call g_oPdfViewer.SetProperty("Commenting.Typewriter.Styles[0].TextFormat.Char.FColor", RGB_val, 0)
All code lines work without any problems except the last one. We don't receive an error but it doesn't change the font color.

I hope you guys have any advice or help!

Thank you!

Regards,
Martin
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17948
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: setting text color of typewriter tool

Post by Tracker Supp-Stefan »

Hello Martin,

Have you checked that the RGB_val is passing the correct value?

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

Re: setting text color of typewriter tool

Post by MartinCS »

Hi Stefan,

I have to correct myself. It works and the text color is the color we set through source code. But the color of the icon doesn't change.


Best,
Martin
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17948
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: setting text color of typewriter tool

Post by Tracker Supp-Stefan »

Hello Martin,

The guys confirmed that this is a bug on our side, so I made a ticket which will allow us to track and fix this bug:
#1058: Viewer SDK: Toolbar button not properly updated when the tool properties are changed

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

Re: setting text color of typewriter tool

Post by MartinCS »

Hi Stefan,

you guys are so fast and reliable!

I'm confident that you're able to solve this problem with ease. Despite this little bug it's been a great pleasure to work with you.


Have a nice weekend!

Martin
User avatar
Paul - Tracker Supp
Site Admin
Posts: 6901
Joined: Wed Mar 25, 2009 10:37 pm
Location: Chemainus, Canada
Contact:

Re: setting text color of typewriter tool

Post by Paul - Tracker Supp »

Thanks for the kind words MartinCS,

you too have a great week end.

:-)
Best regards

Paul O'Rorke
Tracker Support North America
http://www.tracker-software.com
User avatar
MartinCS
User
Posts: 153
Joined: Thu Apr 07, 2011 10:01 am
Contact:

Re: setting text color of typewriter tool

Post by MartinCS »

Hi Paul,

thank you ... ;)

This morning I encountered another problem with the typewriter tool. Using the methods 'GetProperty' and 'SetProperty' I am able to modify the font size of the Char container programmatically. When I set the font size property with:

Code: Select all

AxCoPDFXCview1.SetProperty("Commenting.Typewriter.Styles[0].TextFormat.Char.FontSize", PDFToolSettings.TypewriterFontSize, 0)
everything works perfect and I'm able to set the font size via source code.

But when I try to get the property of the font size with:

Code: Select all

AxCoPDFXCview1.GetProperty("Commenting.Typewriter.Styles[0].TextFormat.Char.FontSize", vDataOut)
I don't get the correct value set by the user using this tool previously.

On the other hand if I set the value through code (see first code line) and then read the new value I get the correct font size value:

Code: Select all

AxCoPDFXCview1.SetProperty("Commenting.Typewriter.Styles[0].TextFormat.Char.FontSize", PDFToolSettings.TypewriterFontSize, 0)
AxCoPDFXCview1.GetProperty("Commenting.Typewriter.Styles[0].TextFormat.Char.FontSize", vDataOut)
MsgBox(vDataOut)
In my opinion there is a problem reading the font size value set by the user via front end. Could you check that, please? If there's a bug indeed it should also work for the other contained objects of the Chr container as well.

Thank you!


Best,
Martin
User avatar
Paul - Tracker Supp
Site Admin
Posts: 6901
Joined: Wed Mar 25, 2009 10:37 pm
Location: Chemainus, Canada
Contact:

Re: setting text color of typewriter tool

Post by Paul - Tracker Supp »

Hi MartinCS,

I've made a note on the ticket to check this also.

regards
Best regards

Paul O'Rorke
Tracker Support North America
http://www.tracker-software.com
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2353
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: setting text color of typewriter tool

Post by Vasyl-Tracker Dev Team »

Hi, MartinCS.
I encountered another problem with the typewriter tool. Using the methods 'GetProperty' and 'SetProperty' I am able to modify the font size of the Char container programmatically. When I set the font size property with:
Code:
AxCoPDFXCview1.SetProperty("Commenting.Typewriter.Styles[0].TextFormat.Char.FontSize", PDFToolSettings.TypewriterFontSize, 0)

everything works perfect and I'm able to set the font size via source code.

But when I try to get the property of the font size with:

Code:
AxCoPDFXCview1.GetProperty("Commenting.Typewriter.Styles[0].TextFormat.Char.FontSize", vDataOut)

I don't get the correct value set by the user using this tool previously.
If I understand you correctly - you wanted to obtain the font size which last used by the user - it's impossible in current implementation.

The Commenting.<Tool>.<StyleN>.TextFormat.Char.FontSize contains the font size which was saved by user especially by UI-feature [Text Editor/Context Menu/Text Format/Set Current Text Formatting as Default] it does not contain the last used font.
The Commenting.<Tool>.<StyleN> objects contain info about different styles of tool, one tool can have more one style. The ID of current style of tool is specified in Tools.<Tool>.Style.
The correct example (C#):

Code: Select all

object curTypewriterStyle;
AxCoPDFXCview1.GetProperty("Tools.Typewriter.Style", out curTypewriterStyle);
string curStylePrefix = "Commenting.Typewriter.Styles[#" + curTypewriterStyle +"].";
object fontSize;
AxCoPDFXCview1.GetProperty(curStylePrefix + "TextFormat.Char.FontSize", out fontSize);
Best
Regards.
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17948
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: setting text color of typewriter tool

Post by Tracker Supp-Stefan »

Hi Martin,

I have some good news. The guys just told me that the problem with the buttons not properly updating outlined in ticket #1058 is now resolved and that the fix will be in build 196 expected by the end of the week.

Best,
Stefan
Post Reply