我正在生成"Word文档",第一页上的标题为HTML代码.<style>
标签包含:
@page Section {
size:8.5in 11.0in;
margin: 0.7in 0.9in 0.7in 0.9in;
mso-header-margin: 0.0in;
mso-footer-margin: 0.0in;
mso-title-page: yes;
mso-first-header: fh1;
mso-paper-source: 0;
}
div.Section {
page: Section;
}
Run Code Online (Sandbox Code Playgroud)
并且<body>:
<div class="Section" style="font-family: Verdana, sans-serif;">
<![if supportFields]>
<div style="mso-element:header" id="fh1">
<p class="MsoHeader">
header
</p>
</div>
<![endif]>
</div>
Run Code Online (Sandbox Code Playgroud)
它在标题和文档主体中显示"标题"文本.资源(http://techsynapse.blogspot.com/2007/03/generating-word-document-dynamically.html和http://www.pbdr.com/ostips/wordfoot.htm)我发现说有如果不使用我不能选择的额外头文件,就无法避免这种影响.
我的问题是:你知道解决这个问题的任何方法吗?如何隐藏主文档中标题的出现但将其保留在页面顶部的位置?提前感谢任何建议.