This is a migrated thread and some comments may be shown as answers.

Style Colors with DocxFormatProvider

1 Answer 38 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Thomas
Top achievements
Rank 1
Thomas asked on 24 Nov 2015, 08:55 AM

Hi!

The DocxFormatProvider resets any Color informations of any Styles to the default light blue when I export with it.

 I export like this:

DocumentFormatProviderBase format = null;
 
format = new DocxFormatProvider();
 
format.Export(radRichTextBox.Document, File.Open(filename, FileMode.Create));

I used versions 2015.3.1104.45, 2015.3.1104.40 and 2015.3.930.40

Did i miss some setting or, if not, is there any workaround?

It works fine with the htmlformatprovider, but i need the header and footer, which is cut off by it.

 

 


 
 
 
 
 
 

1 Answer, 1 is accepted

Sort by
0
Tanya
Telerik team
answered on 26 Nov 2015, 05:01 PM
Hello Thomas,

Indeed, this is an issue in the DocxFormatProvider related to  the priority of the different colors, set to the style. In this case, the theme color, which is with higher priority, is not cleared from the style and takes advantage when the document is visualized.

I logged the issue in our bug tracking system and you could subscribe to the related public item in order to receive updates about status changes on it. Your Telerik points are updated as a token of appreciation for this report.

To work around this, you could set the forecolor of the style in the code-behind:
StyleDefinition style = this.radRichTextBox.Document.StyleRepository["Heading1"];
style.SpanProperties.ForeColor = Colors.Red;
 
StyleDefinition styleChar = this.radRichTextBox.Document.StyleRepository["Heading1Char"];
styleChar.SpanProperties.ForeColor = Colors.Red;

Hope this helps.

Regards,
Tanya
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
RichTextBox
Asked by
Thomas
Top achievements
Rank 1
Answers by
Tanya
Telerik team
Share this question
or