跳到主要内容

SetTitlePage

Specifies whether the current section in this document has the different header and footer for the section first page.

Syntax

expression.SetTitlePage(isTitlePage);

expression - A variable that represents a ApiSection class.

Parameters

NameRequired/OptionalData typeDefaultDescription
isTitlePageRequiredbooleanIf true, the first page of the section will have header and footer that will differ from the other pages of the same section.

Returns

boolean

Example

This example specifies whether the current section in this document has the different header and footer for the section first page.

// How to make a page a title one.

// Create a section and make its set its page as a title one.

let doc = Api.GetDocument();
let paragraph = doc.GetElement(0);
paragraph.AddText("This page does not have a footer, as it is a title page. ");
paragraph.AddText("Scroll down the page to see if the footer was removed.");
let section = doc.CreateSection(paragraph);
section.SetTitlePage(true);
let footer = section.GetFooter("default", true);
paragraph = footer.GetElement(0);
paragraph.AddText("This is page footer. ");
paragraph.AddText("You will only see it for page #2.");
paragraph = Api.CreateParagraph();
paragraph.AddText("This is page #2 and it has a footer. ");
paragraph.AddText("Scroll down the page to see it.");
doc.Push(paragraph);