读取 RTF 文件并删除动态文本

发布于 2024-10-03 20:00:50 字数 307 浏览 1 评论 0原文

我的 RTF 文件开头包含如下文本:

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Trebuchet MS;}{\f1\fswiss\fprq2\fcharset0 Verdana ;}{\f2\fnil\fcharset0 Tahoma;}{\f3\fnil\fcharset0 Arial;}{\f4\froman\fprq2\fcharset0 Times New Roman;}}

如何读取 RTF 文件并替换有什么我想要的吗?

My RTF File contains a text in the beginning like below:

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Trebuchet MS;}{\f1\fswiss\fprq2\fcharset0 Verdana;}{\f2\fnil\fcharset0 Tahoma;}{\f3\fnil\fcharset0 Arial;}{\f4\froman\fprq2\fcharset0 Times New Roman;}}

How can i Read the RTF File and replace with anything i wish?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

怪我鬧 2024-10-10 20:00:50

如果您想自己生成 RTF 标头,您应该查看 RTF 规范
否则,您可能可以简单地使用 RichTextBox-Control,设置字体样式/颜色等并从 RTFText-Property 获取标题。

If you want to generate the RTF Header yourself you should take a look at the RTF Spec.
Otherwise you might be able to simply use the RichTextBox-Control, set the font-style/color etc. and get the header from the RTFText-Property.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文