将目录添加到 RTF 文档 [英] Add table of contents to RTF document

查看:99
本文介绍了将目录添加到 RTF 文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试手动生成 RTF 文档,并最终以编程方式完成.我计划改进 pyRTF 以便它可以生成目录",我认为它不能.

I am trying to generate a RTF document by hand and eventually will do it programtically. I plan to improve pyRTF so that it can generate "Table of contents", which I think it can't.

我无法使用 RTF 控制字(\tc、\tcf 和 \tcl.)来生成目录.http://msdn.microsoft.com/en-us/library/aa140283(office.10).aspx 提供了有关 TOC 的详细信息,但我找不到或无法制作任何具有 TOC 的示例 RTF.

I am not able to use RTF controls words (\tc, \tcf and \tcl.) to generate a TOC. http://msdn.microsoft.com/en-us/library/aa140283(office.10).aspx gives details about TOC but I couldn't find or make any example RTF which have a TOC.

那么是否有一个简单的示例显示带有 TOC 的 RTF?

So is there a simple sample showing a RTF with TOC?

推荐答案

我正在创建一个表格,其中包含指向书签的超链接以及各个页面上的标题.

I am creating a Table with hyperlinks to bookmarks to title on various pages.

例如

'{\\field{\\*\\fldinst  HYPERLINK \\\\l "%s"} {\\fldrslt %s}}'%(bookmark, text)
"{\\field{\\*\\fldinst  PAGEREF %s }}"%bookmark

这篇关于将目录添加到 RTF 文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆