gpt4 book ai didi

java - 我可以使用 mime 类型 application/msword 将页码添加到动态生成的文档中吗?

转载 作者:行者123 更新时间:2023-12-02 08:18:35 25 4
gpt4 key购买 nike

如何使用 mime 类型 application/msword 将页码添加到动态生成的文档?

最佳答案

是的,您可以在动态生成的文档中添加页码。要获取代码,打开一个新文档,在页眉/页脚中启用页码,将其另存为单页网页(*.htm),在任何文本编辑器(例如记事本)中打开生成的文件 分析代码,取出显示页码的代码。在这里,我尝试将页码显示为第 1 页,共 15 页,就像那样。这是我从 *.htm 文件中获得的代码注意:您可能还需要复制关联的样式。

<style>
@page Section1
{
size:11.0in 8.5in;
mso-footer: url("http://images/footer.htm")f1;
mso-header: url("http://images/header.htm")h1;
mso-page-orientation:landscape;
margin:0.3in 0.5in 0.4in 0.5in;
mso-header-margin:.2in;
mso-footer-margin:.2in;
mso-paper-source:0;
font-family:Gill Sans MT, Times New Roman, Trebuchet MS;
}
div.Section1
{ page:Section1;}
@page Section2
{
size:11.0in 8.5in;
mso-footer: url("http://images/footer.htm")f1;
mso-header: url("http://images/header2.htm")h2;
mso-page-orientation:landscape;
margin:0.3in 0.5in 0.4in 0.5in;
mso-header-margin:.2in;
mso-footer-margin:.2in;
mso-paper-source:0;
font-family:Gill Sans MT, Times New Roman, Trebuchet MS;
}
</style>
-------------

------=_NextPart_000_0019_01CA5EDF.DC424910
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Location: http://images/footer.htm

<!--[if supportFields]>
<div style=3D'mso-element:footer;' id=3D'f1'>
<p class=3D'MsoFooter' style=3D'border:none;mso-border-bottom-alt:solid windowtext .75pt;padding:0in;mso-padding-alt:0in 0in 1.0pt 0in'>
<table border=3D"0" width=3D"100%" cellpadding=3D"0" cellspacing=3D"0">
<tr>

<td width=3D"25%" align=3D"right"style=3D"font-family:Gill Sans MT, Times New Roman, Trebuchet MS;font-size:16pt;color:#6cbc48;font-weight:bold;padding:7px 30px 0px 0px;" valign=3D"middle">
Page <span style=3D'**mso-field-code: PAGE**' ></span> of <span style=3D'**mso-field-code:NUMPAGES** '></span>&nbsp;
</td>

</tr>
</table>

关于java - 我可以使用 mime 类型 application/msword 将页码添加到动态生成的文档中吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5888572/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com