I've got a problem converting RTF code to HTML code (with streams, without files). The HTML output code isn't correct.
- Code: Select all
Spire.Doc.Document doc = new Spire.Doc.Document();
System.Text.ASCIIEncoding asc = new System.Text.ASCIIEncoding();
byte[] bArrRTF = asc.GetBytes(richTextBox1.Rtf);
System.IO.MemoryStream msRTF = new System.IO.MemoryStream(bArrRTF);
doc.LoadFromStream(msRTF, Spire.Doc.FileFormat.Rtf);
System.IO.MemoryStream msHTML = new System.IO.MemoryStream();
doc.HtmlExportOptions.CssStyleSheetType = Spire.Doc.CssStyleSheetType.Internal;
doc.SaveToStream(msHTML, Spire.Doc.FileFormat.Html);
System.Text.UTF8Encoding utf = new UTF8Encoding();
string strHTMLCode = utf.GetString(msHTML.ToArray());
The html output contains "\r\n" instead of "<br>" (for example).
Pictures and font colors are missing.
What could be wrong?
Thanks in advance