Convert RTF Stream to Plain Text Stream

2019-07-24 12:08发布

问题:

I have crystal report and I need to convert it to text file. Currently I can only convert it to RTF Stream. Now I need to convert the RTF Stream to Text Stream. I am using C#.

Thanks.

回答1:

Correct me if I am wrong but you are using the ExportToStream method with ExportFormatType.RichText:

Stream stream = report.ExportToStream(ExportFormatType.RichText);

This exports the report into an RTF stream. Now you wish to convert this stream to plain text (extract the text from the RTF). If that's true then this thread might have the answer for you.