清除 RTF 中的 \listlevel 状态

发布于 2024-07-09 12:42:11 字数 1016 浏览 5 评论 0原文

我正在从文字处理组件输出 RTF。 此方法运行良好,但在特定情况下会失败,因为它会导致 Word 2000 损坏文档。 不过,Word 2007 可以很好地处理 RTF,这意味着他们修复了一些问题。 但是,我需要能够输出适用于任何版本的 Word 的 RTF。

所需的文本如下:

1. Title
blah blah blah

这里的关键是这是在表格单元格中输出的。 下面提取了正在输出的 RTF。 设置一个列表来输出用于标题的编号文本。 然后有一个 \pard 重置它(下面用两颗星突出显示)并输出纯文本。 如果在单元格中使用 \pard,则 Word 2000 会崩溃。 如果省略,则效果很好。 但随后 Word 2007 也会显示带有编号序列的下一行。

\trowd \clvertalt\cellx4300\clvertalt\cellx8600\intbl
{\ql\fi-432\li432\sb240\sa0\tx432\plain\s71\f1\fs20 
{\listtext 1.\tab 
}\ls1\ilvl0 title
\par**\pard**\ql\sa120\plain\s24\f1\fs20 blah blah blah
\par\cell\ql\fi0\li0\ri0\sb0\sa0\plain\s23\f12\fs20 \cell 
}\intbl
{\row 
}\trowd \clvertalt\cellx4300\clvertalt\cellx8600\intbl
{\ql\fi0\li0\ri0\sb0\sa0\plain\s23\f12\fs20\cell\ql\fi0\li0\ri0\sb0\sa0\plain\s23\f12\fs20 
\par\cell 
}\intbl
{\row 
}\pard 
{\ql\fi0\li0\ri0\sb0\sa0\plain\s23\f12\fs20 
\par
}

如果有人可以建议如何从 blah blah blah 行中清除列表级别 \ls1,或者 \pard 可能存在什么问题,那么我将非常感激。 谢谢!

I am outputting RTF from a word processor component. This is working well, but there is a specific situation that is failing in that it causes Word 2000 to corrupt the document. Word 2007 is fine with the RTF though, which implies they fixed something. However, I need to be able to output RTF which will work with any version of Word.

The text that is wanted is as follows:

1. Title
blah blah blah

The key here is that this is output in a table cell. The RTF being output is extracted below. A list is set up to output numbered text which is used for the title. Then there is a \pard which resets it (highlighted below with two stars) and the plain text is output. If the \pard is used in the cell, then Word 2000 crashes. If omitted, it works fine. But then Word 2007 shows the next line with a numbered sequence too.

\trowd \clvertalt\cellx4300\clvertalt\cellx8600\intbl
{\ql\fi-432\li432\sb240\sa0\tx432\plain\s71\f1\fs20 
{\listtext 1.\tab 
}\ls1\ilvl0 title
\par**\pard**\ql\sa120\plain\s24\f1\fs20 blah blah blah
\par\cell\ql\fi0\li0\ri0\sb0\sa0\plain\s23\f12\fs20 \cell 
}\intbl
{\row 
}\trowd \clvertalt\cellx4300\clvertalt\cellx8600\intbl
{\ql\fi0\li0\ri0\sb0\sa0\plain\s23\f12\fs20\cell\ql\fi0\li0\ri0\sb0\sa0\plain\s23\f12\fs20 
\par\cell 
}\intbl
{\row 
}\pard 
{\ql\fi0\li0\ri0\sb0\sa0\plain\s23\f12\fs20 
\par
}

If anyone can suggest how to clear the list level \ls1 from the blah blah blah line, or what the problem with \pard might be, then I'd much appreciate it. Thanks!

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

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

发布评论

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

评论(1

堇年纸鸢 2024-07-16 12:42:11

好吧,经过大量调查后,一位同事发现答案是在导致问题的 \pard 之后添加一个 '\intbl'。 据推测,在构建数据时,需要在 Word 中重新设置标志。

Okay, after lots more investigation, a colleague found the answer was to add a '\intbl' after the \pard that caused the problem. Presumably this is needed to re-set a flag in Word while it is building the data.

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