使用Aspose.Words在asp.net中读取RTF文件内容

问题描述 投票:0回答:1

我需要读取一个包含一些文本的.RTF文件,然后将其保存在一个String变量中,我在网上搜索很多,而且没有免费的方法来完成它。我有Aspose.Words的商业许可证,它可能与该库(或以各种方式)相关吗?

最好的祝福。

asp.net rtf aspose.words
1个回答
1
投票

您可以使用以下简单的Aspose.Words代码获取RTF文档的文本表示:

Document doc = new Document("E:\\temp\\in.rtf");
string rtfText = doc.ToString(SaveFormat.Text);

希望这可以帮助。我和Aspose一起担任开发者布道者。

© www.soinside.com 2019 - 2024. All rights reserved.