/// <summary> /// Test generate rtf file /// after execute this function you can open c:\a.rtf /// </summary> internal static void TestWriteFile( ) { RTFWriter w = new RTFWriter("c:\\a.rtf"); TestBuildRTF(w); w.Close(); System.Windows.Forms.MessageBox.Show("OK , you can open file c:\\a.rtf 了."); }
/// <summary> /// Save rtf to a stream /// </summary> /// <param name="stream">stream</param> public void Save(System.IO.Stream stream) { using (var writer = new RTFWriter(new System.IO.StreamWriter(stream, Encoding))) { Write(writer); writer.Close(); } }
/// <summary> /// save rtf file /// </summary> /// <param name="strFileName">file name</param> public void Save(string strFileName) { using (var writer = new RTFWriter(strFileName)) { Write(writer); writer.Close(); } }
/// <summary> /// Test generate rtf text and copy to windows clipboard /// after execute this function , you can paste rtf text in MS Word /// </summary> internal static void TestClipboard() { System.IO.StringWriter myStr = new System.IO.StringWriter(); RTFWriter w = new RTFWriter(myStr); TestBuildRTF(w); w.Close(); System.Windows.Forms.DataObject data = new System.Windows.Forms.DataObject(); data.SetData(System.Windows.Forms.DataFormats.Rtf, myStr.ToString()); System.Windows.Forms.Clipboard.SetDataObject(data, true); System.Windows.Forms.MessageBox.Show("OK, you can paste words in MS Word."); }
/// <summary> /// test /// </summary> internal static void Test() { var doc = new RTFRawDocument(); doc.Load(@"d:\abc.rtf"); //System.Console.WriteLine( doc.Text ); var writer = new RTFWriter(@"d:\a.rtf"); writer.Indent = true; doc.Write(writer); writer.Close(); }
/// <summary> /// test /// </summary> internal static void Test() { RTFRawDocument doc = new RTFRawDocument(); doc.Load(@"d:\abc.rtf"); //System.Console.WriteLine( doc.Text ); RTFWriter writer = new RTFWriter(@"d:\a.rtf"); writer.Indent = true ; doc.Write( writer ); writer.Close(); }
/// <summary> /// Save rtf to a stream /// </summary> /// <param name="stream">stream</param> public void Save( System.IO.Stream stream ) { using( RTFWriter writer = new RTFWriter( new System.IO.StreamWriter( stream , this.Encoding ))) { this.Write( writer ); writer.Close(); } }
/// <summary> /// save rtf file /// </summary> /// <param name="strFileName">file name</param> public void Save( string strFileName ) { using( RTFWriter writer = new RTFWriter( strFileName )) { this.Write( writer ); writer.Close(); } }
/// <summary> /// Save rtf to a stream /// </summary> /// <param name="stream">stream</param> public void Save(Stream stream) { using (var writer = new RTFWriter(new StreamWriter(stream, Encoding))) { Write(writer); writer.Close(); } }
/// <summary> /// Test generate rtf file /// after execute this function you can open c:\a.rtf /// </summary> internal static void TestWriteFile( ) { RTFWriter w = new RTFWriter( "c:\\a.rtf" ) ; TestBuildRTF( w ); w.Close(); System.Windows.Forms.MessageBox.Show("OK , you can open file c:\\a.rtf ��."); }
/// <summary> /// Test generate rtf text and copy to windows clipboard /// after execute this function , you can paste rtf text in MS Word /// </summary> internal static void TestClipboard() { System.IO.StringWriter myStr = new System.IO.StringWriter(); RTFWriter w = new RTFWriter( myStr ); TestBuildRTF( w ); w.Close(); System.Windows.Forms.DataObject data = new System.Windows.Forms.DataObject(); data.SetData( System.Windows.Forms.DataFormats.Rtf , myStr.ToString()); System.Windows.Forms.Clipboard.SetDataObject( data , true ); System.Windows.Forms.MessageBox.Show("OK, you can paste words in MS Word."); }