Delphi: best way to convert rtf to text

前端 未结 2 1688
半阙折子戏
半阙折子戏 2020-12-11 05:49

I need to convert rtf to plain text. i used to write a function that strips away rtf headers but it is never perfect.

So one option can be using a TRichEdit created

2条回答
  •  再見小時候
    2020-12-11 06:01

    If you really want to find a way of doing this conversion you should take a look at how the class TConversion is implemented in the class TRichEditStrings. These classes are in ComCtrls.pas. By understanding how the conversion is done inside the RichEdit controls you may be able to write your own.

    However, looking at the practical aspects of implementing this and not knowing what the performance requirements are for your question I would go for the TRichEdit conversion approach outlined in your link.

提交回复
热议问题