IgnoreHeaderFooter

ImportFormatOptions.IgnoreHeaderFooter property

Gets or sets a boolean value that specifies that source formatting of headers/footers content ignored if KeepSourceFormatting mode is used. The default value is true.

public bool IgnoreHeaderFooter { get; set; }

Examples

Shows how to specifies ignoring or not source formatting of headers/footers content.

Document dstDoc = new Document(MyDir + "Document.docx");
Document srcDoc = new Document(MyDir + "Header and footer types.docx");

// If 'IgnoreHeaderFooter' is false then the original formatting for header/footer content
// from "Header and footer types.docx" will be used.
// If 'IgnoreHeaderFooter' is true then the formatting for header/footer content
// from "Document.docx" will be used.
ImportFormatOptions importFormatOptions = new ImportFormatOptions();
importFormatOptions.IgnoreHeaderFooter = false;

dstDoc.AppendDocument(srcDoc, ImportFormatMode.KeepSourceFormatting, importFormatOptions);

dstDoc.Save(ArtifactsDir + "DocumentBuilder.DoNotIgnoreHeaderFooter.docx");

See Also