If you look into the word, all the sections have headers. Two sections starting with AccurriStart_47335 and AccurriStart_47336 don’t. It’s our main issue and the showstopper. If you could let me know what’s the difference between the headers in these 2 sections and others stopping Aspose from converting these headers into HTML, I can try to workaround it (or possibly you can suggest a workaround).
The footers location in html is different from the word (see the attached screenshot)
Thank you in advance,
Alex
@AlexanderNovickov The problem is that HTML and MS Word documents are very different in concepts. It is hard to meaningfully output headers and footers to HTML because HTML is not paginated. By default Aspose.Words exports only primary headers/footers of the document per section when saving to HTML. You can try changing ExportHeadersFootersMode to configure how headers/footers are exported to HTML, as you already do in your code.
You should note, however, that HTML documents and MS Word documents object models are quite different and it is not always possible to provide 100% fidelity after conversion one format to another.
If the output HTML is for viewing purposes, i.e. it is not supposed to be edited or processed, you can consider using HtmlFixed format. In this case the output should look exactly the same as it looks in MS Word:
HtmlFixed format is designed to preserve original document layout for viewing purposes. So if your goal is to display the HTML on page, then this format can be considered as an alternative. But unfortunately, it does not support roundtrip to DOCX at all.
The sections starting with AccurriStart_47335 and AccurriStart_47336 have only primary headers/footers, but in your code you have specified ExportHeadersFootersMode.FirstPageHeaderFooterPerSection. In this mode, the first page header and footer are exported at the beginning and the end of each section.
As mentioned above, HTML content is not paginated, so footer is shown at the end of the section, not at the end of the page.