Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

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());
}
Comment

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);
}
Comment

PREVIOUS NEXT
Code Example
Java :: Write a java program to print a number from the user 
Java :: create a class 
Java :: java scan next into array 
Java :: How to change numbers to english in printf 
Java :: who was the mother of thomas elva edison 
Java :: how to split each string of a line 
Java :: how to move get selected from jfxtreetableview javafx 
Java :: android studio see what activity you came from 
Java :: before first in jdbc 
Java :: substring in java 
Java :: android getdrawable before api 21 
Java :: Java Catching base and child exception classes 
Java :: randpm years java 
Java :: public class Hello { public static void main( String[] args ){ System.out.println("Hello World"); } } 
Java :: Volkswagen fox 
Java :: how to wait in the javaprogram 
Java :: Sample TreeMap 
Java :: What are the design patterns involved in JDBC architecture? 
Java :: heap vs string constant pool 
Java :: constraints in Grails 
Java :: java equivalent of pythons getattr 
Java :: Java Creating ArrayDeque 
Java :: how to set slected row color in javafx tableview 
Java :: value of for loop i in Jbutton 
Java :: save documents on Android 11 site:stackoverflow.com 
Java :: check java variable type using getSimpleName method 
Java :: Eclipse find/replace pluggin 
Java :: like clause with param in spring jpa 
Java :: random years java 
Java :: java como comprobar que un numero es entero? 
ADD CONTENT
Topic
Content
Source link
Name
2+1 =