在Coldfusion中创建Word文档 - 如何进行编码? [英] Creating a Word document in Coldfusion - how to have pagenumbering?
本文介绍了在Coldfusion中创建Word文档 - 如何进行编码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用以下代码创建Word格式.doc,然后使用cfheader和cfcontent来服务。一切都很好,但我需要能够在标题(或页脚)中放置动态信息,或自动pagenumbering将是第二个最好的选择。
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>
推荐答案
请看看: Header& Footer
我已经使用本文成功创建了只有一个html文件的自定义页眉和页脚。 (Word 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屋!
查看全文