HeaderFooterType
Contents
[
Hide
]HeaderFooter.HeaderFooterType property
Gets the type of this header/footer.
public HeaderFooterType HeaderFooterType { get; }
Examples
Shows how to create a header and a footer.
Document doc = new Document();
// Create a header and append a paragraph to it. The text in that paragraph
// will appear at the top of every page of this section, above the main body text.
HeaderFooter header = new HeaderFooter(doc, HeaderFooterType.HeaderPrimary);
doc.FirstSection.HeadersFooters.Add(header);
Paragraph para = header.AppendParagraph("My header.");
Assert.True(header.IsHeader);
Assert.True(para.IsEndOfHeaderFooter);
// Create a footer and append a paragraph to it. The text in that paragraph
// will appear at the bottom of every page of this section, below the main body text.
HeaderFooter footer = new HeaderFooter(doc, HeaderFooterType.FooterPrimary);
doc.FirstSection.HeadersFooters.Add(footer);
para = footer.AppendParagraph("My footer.");
Assert.False(footer.IsHeader);
Assert.True(para.IsEndOfHeaderFooter);
Assert.AreEqual(footer, para.ParentStory);
Assert.AreEqual(footer.ParentSection, para.ParentSection);
Assert.AreEqual(footer.ParentSection, header.ParentSection);
doc.Save(ArtifactsDir + "HeaderFooter.Create.docx");
See Also
- enum HeaderFooterType
- class HeaderFooter
- namespace Aspose.Words
- assembly Aspose.Words