views:

424

answers:

2

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.

A: 

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.

Antony
+6  A: 

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"&gt;
 ...
 <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.

Leigh
Thanks, that worked like a charm.
Hooray Im Helping