Answers for "how to save rich text format in database using java"

0

how to save rich text format in database using java

string rtfText= ... //string from db
byte[] byteArray = Encoding.ASCII.GetBytes(rtfText);
using (MemoryStream ms = new MemoryStream(byteArray))
{
    TextRange tr = new TextRange(richTextBox.Document.ContentStart, richTextBox.Document.ContentEnd);
    tr.Load(ms, DataFormats.Rtf);
}
Posted by: Guest on November-19-2020
0

how to save rich text format in database using java

string rtfText; //string to save to db
TextRange tr = new TextRange(richTextBox.Document.ContentStart, richTextBox.Document.ContentEnd);
using (MemoryStream ms = new MemoryStream())
{
    tr.Save(ms, DataFormats.Rtf);
    rtfText = Encoding.ASCII.GetString(ms.ToArray());
}
Posted by: Guest on November-19-2020

Code answers related to "how to save rich text format in database using java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language