Is there a way to append content to a RTF file format? I need it for the following functionality. When adding a Paragraph to the FlowDocument, I need to write it to the RTF file, also. Till now I was saving the entire FlowDocument into the file. In addition, I don't want to keep the more than 10000 Paragraphs in memory.
Here is a piece of code I tried but it didn't work.
TextRange tr = new TextRange(flowDoc.ContentStart, flowDoc.ContentEnd);
FileStream file = new FileStream(path, FileMode.Append,FileAccess.ReadWrite, FileShare.Read);
tr.Save(file, DataFormats.Rtf);
TextWriter tw = new StreamWriter(file);
tw.Write(file.ToString());
tw.Close();
Thanks!