Coldfusion CF内容 Word 文档上的分页符



我正在使用cfcontent来创建Word文档。

例:

<cfsavecontent variable="sStr">
   part1
   part2
   part3 
</cfsavecontent>
<cfheader name="content-disposition" value="attachment; filename=wordDoc.doc">
<cfcontent type="application/msword" variable="#sStr#">

我希望每个部分之后的分页符。

输出应为横向格式。我该怎么做?

对于分页符,您应该使用:

<cfdocumentitem type="pagebreak" />

您可以通过以下方式设置景观:

<cfdocument orientation = "portrait|landscape>

据我所知,不可能更改单个页面的方向。

对于已保存以创建MS Word文档的文件的cfcontent:

<br clear=3Dall style=3D'page-break-before:always;mso-break-type:section-break'>
使用以下

样式并确保在 cfcontent reset="no"中获取页面方向以使用 ms word;

<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">
<head>
<title>Work Order Report</title>
<style>
 @page Section1
 {   size:11.0in 8.5in;
     mso-page-orientation:landscape;
 }
 body.section1 {page:section1;}
</style>
<body class="section1">
<cfcontent type="application/msword" reset="no"> 

最新更新