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

RadRichTextBox - Export/Import issue

1 Answer 159 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
pratik mehta
Top achievements
Rank 1
pratik mehta asked on 23 Jul 2010, 09:58 AM
Hello,

    I'm using a RadRichTextBox to import a RadDocument and HTML text using the code below:-

 

 

string content = @"<P>We <B>operate</B> as a vehicle to enable clients to access managed accounts.</P>";

 

 

 

 

IDocumentFormatProvider provider = new HtmlFormatProvider();

 

 

 

RadDocument document;

 

 

 

using (MemoryStream stream = new MemoryStream())

 

{

 

 

StreamWriter writer = new StreamWriter(stream);

 

writer.Write(content);

writer.Flush();

stream.Seek(0,

 

SeekOrigin.Begin);

 

document = provider.Import(stream);

}

 

 

return document;

 


The text (with bold formatting) shows up correctly in the RadRichTextBox. I then Export the text to HTML using the code below:-

 

 

IDocumentFormatProvider exporter = new HtmlFormatProvider();

 

 

 

var output = new MemoryStream();

 

exporter.Export(editor.Document, output);

output.Seek(0,

 

SeekOrigin.Begin);

 

 

 

var reader = new StreamReader(output);

 

 

 

return reader.ReadToEnd();

 


I take the HTML export output and save it as a .html file. When I open this file in IE, the Bold formatting is lost. Likewise, any Italic (or for that matter, any formatting is lost if viewed in Internet Explorer).

Please advice if I'm making any mistake or provide resolution.

Thanks.

1 Answer, 1 is accepted

Sort by
0
Mike
Telerik team
answered on 28 Jul 2010, 12:48 PM
Hi Pratik Mehta,

We tested this issue with the latest version (Q2 2010) and unfortunately, we were unable to reproduce this problem. Please find attach the HTML file generated from your sample code and let us know if it is as you expect. I opened this HTML file in Internet Explorer 8, Firefox 3.6 and Chrome 5 and it renders as expected (with preserved formatting). You can compare it with version generated at your side. Please make sure that you are using the latest version (2010.2.714.1040).
Let us know if the problem persists.

Kind regards,
Mike
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
Tags
RichTextBox
Asked by
pratik mehta
Top achievements
Rank 1
Answers by
Mike
Telerik team
Share this question
or