Java Code to Export Header & Footers Content in Word DOCX Document to Plain Text Format TXT with Aspose.Words

Not able to find the header and footer content during conversion docx to txt file
Using aspose-words-18.11
File is attached for reference (Both the files are attached , the docx and the converted txt file)TestBatch.zip (58.7 KB)

@rabinintig,

Please upgrade to the latest (20.11) version of Aspose.Words for Java and use TxtSaveOptions.ExportHeadersFootersMode property like this:

Document doc = new Document(@"C:\Temp\TestBatch\\DemoText.docx");

TxtSaveOptions txtSaveOptions = new TxtSaveOptions();
txtSaveOptions.ExportHeadersFootersMode = TxtExportHeadersFootersMode.AllAtEnd;

doc.Save(@"C:\Temp\TestBatch\20.11.txt", txtSaveOptions);

This issue has occured in JAVA 8 not for .NET

@rabinintig,

Java equivalent of above code is as follows:

Document doc = new Document("C:\\Temp\\TestBatch\\DemoText.docx");

TxtSaveOptions txtSaveOptions = new TxtSaveOptions();
txtSaveOptions.setExportHeadersFootersMode(TxtExportHeadersFootersMode.ALL_AT_END);

doc.save("C:\\Temp\\TestBatch\\awjava-20.11.txt", txtSaveOptions);