This message was posted using Page2Forum from Feature Overview - Aspose.Words for .NET
Thanks for your request. In your case, you can save RTF to stream and then extract RTF string from this stream. Code will look like this:
private static string GetRtfString(string html)
string rtfString = "";
// Create a document and insert HTML into it.
DocumentBuilder builder = new DocumentBuilder();
// Save document to stream as RTF and get RTF string.
using (MemoryStream rtfStream = new MemoryStream())
byte rtfBytes = rtfStream.ToArray();
rtfString = Encoding.UTF8.GetString(rtfBytes);
Than after editing, you can load RTF back into the Document object and save it inany format supported by Aspose.Words. Code will look like this:
private static Document RtfStringToDocument(string rtf)
Document doc = null;
// Convert RTF string to byte array.
byte rtfBytes = Encoding.UTF8.GetBytes(rtf);
// Create stream.
using(MemoryStream rtfStream = new MemoryStream(rtfBytes))
// Open document from stream.
doc = new Document(rtfStream);
Hope this helps.
Thanks for your request. What format is used by your ReachTextBox? Maybe your textbox uses HTML, but not RTF. In this case, you can use the same technique to convert a document into HTML string.