跳到主要内容

GetFooter

返回指定页脚类型的内容。

语法

expression.GetFooter(sType, isCreate);

expression - 表示 ApiSection 类的变量。

参数

名称必需/可选数据类型默认值描述
sType必需HdrFtrType要获取内容的页脚类型。
isCreate可选booleanfalse指定在当前节中找不到指定类型的页脚时是否创建具有该类型的新页脚。

返回值

ApiDocumentContent

示例

此示例展示如何获取指定页脚类型的内容。

// How to get the footer of the page.

// Get the default footer from the final section.

let doc = Api.GetDocument();
let paragraph = doc.GetElement(0);
paragraph.AddText("This is a page with a footer. ");
paragraph.AddText("Scroll down the page to see it.");
let section = doc.GetFinalSection();
let footer = section.GetFooter("default", true);
paragraph = footer.GetElement(0);
paragraph.AddText("This is a page footer");