在 ColdFusion 7 中使用 cfcontent,如何以横向模式输出 MS Word 文档?

发布于 2024-08-06 14:50:47 字数 292 浏览 2 评论 0原文

标题是非常不言自明的。我正在使用 cfcontent 将页面输出为 application/msword 文件类型,我想知道如何使其默认为横向模式,而不需要下载第三方库。

The title is pretty self explanatory. I'm using cfcontent in ColdFusion 7 to output a page as an application/msword file type and I want to know how to make it default to landscape mode without resorting to downloading a third party library.

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

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

发布评论

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

评论(2

黎夕旧梦 2024-08-13 14:50:48

如果内容只是 html,您可以使用 mso/xml 模式。还有比这更多的内容,但“mso-page-orientation”属性应该可以解决问题。

<html xmlns:o="urn:schemas-microsoft-com:office:office"
    xmlns:w="urn:schemas-microsoft-com:office:word"
    xmlns="http://www.w3.org/TR/REC-html40">
 ...
 <style>
 <!--
  @page Section1
  {   size:11.0in 8.5in;
      mso-page-orientation:landscape;
      ...
  }
 -->
 </style>

为了快速开始,请在 MS Word 中创建一个非常简单的文档。更改方向等并将其另存为 html。生成的 html 会有点冗长,但很容易理解。

If the content is just html, you could use the mso/xml schemas. There is a bit more to it than this, but the "mso-page-orientation" property should do the trick.

<html xmlns:o="urn:schemas-microsoft-com:office:office"
    xmlns:w="urn:schemas-microsoft-com:office:word"
    xmlns="http://www.w3.org/TR/REC-html40">
 ...
 <style>
 <!--
  @page Section1
  {   size:11.0in 8.5in;
      mso-page-orientation:landscape;
      ...
  }
 -->
 </style>

For a good quick start, create a very simple document in MS Word. Change the orientation etcetera and save it as html. The generated html will be a bit verbose, but is pretty easy to understand.

嗳卜坏 2024-08-13 14:50:48

如果您要创建基于 rtf 的文档,请查看 此页面了解一些想法:

我不知道这有多大帮助,但是
我创建了一个简单的 RTF 文件
MS-Word,然后看了一下。我
在一些内容中发现了以下内容
格式:

\paperw15840\paperh12240

15840 为 1440 * 11 12240 为 1440 * 8.5

该页面上有其他站点的链接,包括 rtf 规范。

If you are creating an rtf-based document, review this page for some ideas:

I don't know how helpful this is, but
I created a simple RTF file in
MS-Word, and then looked at it. I
found the following in some of the
formatting:

\paperw15840\paperh12240

15840 is 1440 * 11 12240 is 1440 * 8.5

There are links to other sites including the rtf specification on that page.

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