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

HTMLFormatProvider and font-style problem

2 Answers 146 Views
RichTextBox (obsolete as of Q3 2014 SP1)
This is a migrated thread and some comments may be shown as answers.
Keiichi-kun
Top achievements
Rank 1
Keiichi-kun asked on 04 Sep 2011, 12:23 PM
Hi all,
I've a problem with HTMLFormatProvider and font-style.
I'm using a radRichTextBox with richRibbonBar (but the problem is also present with a button that execute radRichTextBox1.toggleItalic() ). For example, I have write the string "foofoofoo" in italic inside radRichTextBox and then, using HTMLFormatProvider, I've got the text associated to the document. 

This is the ExportToHTML function

public string ExportToHTML(RadDocument document)
        {
            HtmlFormatProvider provider = new HtmlFormatProvider();
            return provider.Export(document);            
        }


This is the string returned:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Untitled</title><style type="text/css">
.p_4451D050 { margin: 0px 0px 12px 0px;text-align: left;text-indent: 0pt;padding: 0px 0px 0px 0px; } 
.s_C54C634B { font-family: 'Calibri';font-style: System.Collections.Specialized.StringCollection;font-size: 16px;color: #000000; } 
</style></head><body><p class="p_4451D050"><span class="s_C54C634B">foofoofoo</span></p></body></html>


There is a problem in font-style settings of css class, because it doesn't write "italic" but "System.Collections....".
So, when I send a html-email in this format I lost this font setting..

I've tried with XamlFormatProvider and italic (as fontweight) is correct.

Thanks a lot for your help

2 Answers, 1 is accepted

Sort by
0
Accepted
Svett
Telerik team
answered on 07 Sep 2011, 06:12 PM
Hi Keiichi-Kun,

Thank you for contacting us and for bringing our attention to this issue.

I managed to reproduce it and I am glad to inform you that we located the problem and it will be addressed in our next major release. However, I was not able to find a work around suitable for the current release and I hope that this is not a show stopper for you. I updated your Telerik points accordingly.

Please do not hesitate to contact me if you have further questions.

Greetings,
Svett
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Keiichi-kun
Top achievements
Rank 1
answered on 27 Sep 2011, 02:49 PM
Hi,
thanks a lot for your reply, I've read on Sep 7 but I've got no time for reply until now, sorry..
I think that the problem is not a big deal :)
Thanks again
Tags
RichTextBox (obsolete as of Q3 2014 SP1)
Asked by
Keiichi-kun
Top achievements
Rank 1
Answers by
Svett
Telerik team
Keiichi-kun
Top achievements
Rank 1
Share this question
or