@mtomlinson,
Thanks for your inquiry. The TxtSaveOptions.ExportHeadersFooters property specifies whether to output headers and footers when exporting in plain text format. Default value is true.
It is hard to meaningfully output headers and footers to plain text because it is not paginated. When this property is true, Aspose.Words exports only primary headers and footers at the beginning and end of each section. You can disable export of headers and footers altogether by setting this property to false.
In your case, we suggest you please export the document to text using following code example. Hope this helps you.
Document doc = new Document(MyDir + "input.docx");
TxtSaveOptions options = new TxtSaveOptions();
options.ExportHeadersFooters = false;
String strText = "";
foreach (Section section in doc.Sections)
{
if (section.PageSetup.DifferentFirstPageHeaderFooter)
strText += section.HeadersFooters[HeaderFooterType.HeaderFirst].ToString(options);
else
strText += section.HeadersFooters[HeaderFooterType.HeaderPrimary].ToString(options);
strText += section.Body.ToString(options);
if (section.PageSetup.DifferentFirstPageHeaderFooter)
strText += section.HeadersFooters[HeaderFooterType.FooterFirst].ToString(options);
else
strText += section.HeadersFooters[HeaderFooterType.FooterPrimary].ToString(options);
}
File.WriteAllText(MyDir + "output.txt", strText);
Best Regards,
Tahir Manzoor