RTF to text with each page header in text content

Hi ,

We have a requirement where we need to convert RTF document to text and text content should have every page header in it.

We don’t find any API in Aspose.words.java.

Can you please provide solution for this? Or any alternative ways to handle this ?

S P K Srinivas.


Thanks for your inquiry. You can use TxtSaveOptions.ExportHeadersFooters property to specify whether to output headers and footers when exporting in plain text format. Default value is true.

Best regards,

Hi Awais,

Thanks for your reply.

TxtSaveOptions has created one header at the top of the ASCII text.But we need header for every page in the ASCII text. Can you please advise on this? We have used the below code for this.

Document doc = new Document("D:\test\test.rtf"); 
TxtSaveOptions txtOptions = new TxtSaveOptions();
doc.save("D:\test\out.txt", txtOptions);

S P K Srinivas


Thanks for your inquiry. Well, as we mention in Remarks section of this property, it is hard to meaningfully output headers and footers to plain text because text file is not paginated. When this property is true, Aspose.Words exports only primary headers and footers at the beginning and end of each section.

PS: There are three types of headers/footers e.g. FooterFirst, FooterPrimary and FooterEven. Similarly we have three types of header e.g. HeaderFirst, HeaderPrimary and HeaderEven.

Best regards,