📜  如何使用java代码示例将富文本格式保存在数据库中

📅  最后修改于: 2022-03-11 14:52:33.813000             🧑  作者: Mango

代码示例1
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());
}