在 Coldfusion 中创建 Word 文档 - 如何进行页码编号? [英] Creating a Word document in Coldfusion - how to have pagenumbering?

查看:12
本文介绍了在 Coldfusion 中创建 Word 文档 - 如何进行页码编号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用以下代码创建 Word 格式的 .doc,然后使用 cfheader 和 cfcontent 来提供服务.一切都很好,但我需要能够在页眉(或页脚)中放置动态信息,否则自动页码将是第二好的选择.

I am creating a Word format .doc using the following code, then cfheader and cfcontent to serve. All is good but I need to be able to place dynamic information in the header (or footer), or automatic pagenumbering would be a second best option.

我应该如何修改代码?

<cfsavecontent variable="myDocument">
<html xmlns:w="urn:schemas-microsoft-com:office:word">
<!--- Head tag instructs Word to start up a certain way, specifically in
print view. --->
    <head>
        <xml>
         <w:WordDocument>
            <w:View>Print</w:View>
            <w:SpellingState>Clean</w:SpellingState>
            <w:GrammarState>Clean</w:GrammarState>
            <w:Compatibility>
             <w:BreakWrappedTables/>
             <w:SnapToGridInCell/>
             <w:WrapTextWithPunct/>
             <w:UseAsianBreakRules/>
            </w:Compatibility>
            <w:DoNotOptimizeForBrowser/>
         </w:WordDocument>
        </xml>
    </head>
<body>
    Regular HTML document goes here
    <!--- Create a page break microsoft style (took hours to find this) 
--->
    <br clear="all"
style="page-break-before:always;mso-break-type:page-break" />
    Next page goes here
</body>
</html>
</cfsavecontent> 

推荐答案

请看这个:页眉 &页脚我已经使用这篇文章成功地创建了自定义页眉和页脚,只有一个 html 文件.(字 2003)

Please have a look at this: Header & Footer I have successfully created custom header and footer with only one html file using this article. (Word 2003)

希望这会有所帮助!

这篇关于在 Coldfusion 中创建 Word 文档 - 如何进行页码编号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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