RtfDomParser.RTFReader.LoadRTFFile C# (CSharp) Method

LoadRTFFile() public method

load rtf document
public LoadRTFFile ( string strFileName ) : bool
strFileName string spcial file name
return bool
        public bool LoadRTFFile( string strFileName )
        {
            //myTokenStack.Clear();
            myCurrentToken = null ;
            if( System.IO.File.Exists( strFileName ))
            {
                System.IO.FileStream stream = new System.IO.FileStream( strFileName , System.IO.FileMode.Open , System.IO.FileAccess.Read );
                myReader = new System.IO.StreamReader( stream , System.Text.Encoding.ASCII );
                myBaseStream = stream;
                myLex = new RTFLex( myReader );
                return true ;
            }
            return false;
        }

Usage Example

Ejemplo n.º 1
0
 /// <summary>
 /// load rtf file
 /// </summary>
 /// <param name="strFileName">file name</param>
 public void Load(string strFileName)
 {
     myEncoding = null;
     using (var reader = new RTFReader())
     {
         if (reader.LoadRTFFile(strFileName))
         {
             Load(reader);
             reader.Close();
         }
         reader.Close();
     }
 }
All Usage Examples Of RtfDomParser.RTFReader::LoadRTFFile