编辑 RTF 并保留标签?
我有一个用 RTF 编写的模板(其中一些标签被应用程序中数据库中的数据替换),但是当我在 MS Word 中编辑它们时,Word 在模板中添加了一些不可见的标签,这会破坏我的标签(我必须在记事本并编辑代码)。
您知道一些严格遵循 RTF 规范的 RTF 编辑器吗?
I have a templates written in RTF (with some tags which are replaced by data from DB in app), but when I edit them in MS Word, Word put some invisible tags to the templates, which destruct my tags (I must open template in Notepad and edit code).
Do you know some editor for RTF, which strict follows RTF specification?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在 Windows 上,我认为附带的应用程序写字板相当不错。
On Windows, the included app Wordpad is pretty decent in my opinion.
好吧,我知道谷歌会找到一堆编辑器,但我没有时间尝试每一个编辑器来找出最好的一个。
所以我寻找好的建议,而不是可用的建议
编辑:我发现并使用此解决方案数周
TE编辑
并且非常好,我推荐它。
OK, I know that google find bunch of editors, but I don`t have time to try each of them to find out best one.
so I search for advice which is good, not which is avialable
EDIT: I found and for weeks use this solution
TE EDIT
and is very good, I recommend it.
RTF 规范允许 RTF 编辑器(例如 Word 或第三方控件)将标签撒在 RTF 文本之间,前提是保持实际的 RTF 显示。 因此,无法保证您的原始模板文本不会受到干扰。 因此,我建议使用 RTF 编辑器 API 在模板中进行任何搜索/替换。 RTF 编辑器知道将 RTF 标签放在一边并按预期访问原始文本。
The RTF spec allows an RTF editor such as Word or a third party control to sprinkle the tags in-between the RTF text, provided that the actually RTF display is maintained. For this reason, there is no way to guarantee that your original template text will not be disturbed. For this reason, I recommend using an RTF editor API to do any search/replacement within your template. The RTF editor knows to put aside the RTF tags and access the original text as intended.