public void CreateFooter()
{
//ExStart
//ExFor:HeaderFooter
//ExFor:HeaderFooter.#ctor(DocumentBase, HeaderFooterType)
//ExFor:HeaderFooterCollection
//ExFor:Story.AppendParagraph
//ExSummary:Creates a footer using the document object model and inserts it into a section.
Document doc = new Document();
HeaderFooter footer = new HeaderFooter(doc, HeaderFooterType.FooterPrimary);
doc.FirstSection.HeadersFooters.Add(footer);
// Add a paragraph with text to the footer.
footer.AppendParagraph("TEST FOOTER");
doc.Save(MyDir + @"\Artifacts\HeaderFooter.CreateFooter.doc");
//ExEnd
doc = new Document(MyDir + @"\Artifacts\HeaderFooter.CreateFooter.doc");
Assert.True(doc.FirstSection.HeadersFooters[HeaderFooterType.FooterPrimary].Range.Text.Contains("TEST FOOTER"));
}