|
@@ -5097,6 +5097,40 @@ namespace OASystem.API.OAMethodLib
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
+
|
|
|
+ #region aspose
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// aspose word 设置页脚
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="builder"></param>
|
|
|
+ /// <param name="footerLabel">页脚内容</param>
|
|
|
+ /// <param name="font">字体名称</param>
|
|
|
+ /// <param name="fontSize"><字体大小/param>
|
|
|
+ public static void AsposeWordSetFooter(DocumentBuilder builder,string footerLabel,string font,int fontSize)
|
|
|
+ {
|
|
|
+ Section currentSection = builder.CurrentSection;
|
|
|
+ var pageSetup = currentSection.PageSetup;
|
|
|
+ pageSetup.DifferentFirstPageHeaderFooter = true;
|
|
|
+
|
|
|
+ //第一页页脚
|
|
|
+ builder.MoveToHeaderFooter(HeaderFooterType.FooterFirst);
|
|
|
+ builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;
|
|
|
+ builder.Font.Name = font;
|
|
|
+ builder.Font.Bold = true;
|
|
|
+ builder.Font.Size = fontSize;
|
|
|
+ builder.Write(footerLabel);
|
|
|
+
|
|
|
+ //非第一页页脚
|
|
|
+ builder.MoveToHeaderFooter(HeaderFooterType.FooterPrimary);
|
|
|
+ builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;
|
|
|
+ builder.Font.Name = font;
|
|
|
+ builder.Font.Bold = true;
|
|
|
+ builder.Font.Size = fontSize;
|
|
|
+ builder.Write(footerLabel);
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
}
|
|
|
}
|
|
|
|