Get Started
Usage API
More information

SetTitlePage

SetTitlePage(isTitlePage)

Specify whether the current section in this document have different header and footer for the section first page.

Parameters:

Name Type Description
isTitlePage boolean

If true the first page of the section will have header and footer that will differ from the other pages of the same section.

Returns:

This method doesn't return any data.

Example

Copy code
builder.CreateFile("docx");
oDocument = Api.GetDocument();
oParagraph = oDocument.GetElement(0);
oParagraph.AddText("This page does not have a footer, as it is a title page. ");
oParagraph.AddText("Scroll down the page to see if the footer was removed.");
oSection = oDocument.CreateSection(oParagraph);
oSection.SetTitlePage(true);
oFooter = oSection.GetFooter("default", true);
oParagraph = oFooter.GetElement(0);
oParagraph.AddText("This is page footer. ");
oParagraph.AddText("You will only see it for page #2.");
oParagraph = Api.CreateParagraph();
oParagraph.AddText("This is page #2 and it has a footer. ");
oParagraph.AddText("Scroll down the page to see it.");
oDocument.Push(oParagraph);
builder.SaveFile("docx", "SetTitlePage.docx");
builder.CloseFile();

Resulting document