When I save my document as html, using Aspose.Words for .NET 9.6, the footer is not generated at the end of the web page. I have a multi-sectional document. The footer is generated in the spot where my first section ends. When producing the Word and PDF versions, the headers and footers work correctly.
The headers and footers are both primary. Also each section has its headers and footer linked to the previous section by using builder.CurrentSection.HeadersFooters.LinkToPrevious(true).
Any ideas please? Could I set ExportHeadersFooters to false and then manually insert my header and footers into the HTML version. If so, what would be the recommended way to do that?
Thanks for your request. Actually, HTML format is one page format and it does not support Headers/Footers natively. MS Word adds special tags to indicate whether an element is Header/Footer or not. This is MS Word “magic”, which it uses to roundtrip HTML to Word and vice versa.
Currently just Primary Header/Footer are exported to HTML using Aspose.Words.
Please follow the link to learn details about how Aspose.Words saves document in the HTML/XHTML and MHTML formats: https://docs.aspose.com/words/net/save-in-html-xhtml-mhtml-formats/
Also could you please attach your input document here for testing? I will check the problem on my side and provide you more information.
Best regards,
Hi Robert,
Thanks for your inquiry. The problem occurs because you use “Link to Previous” option for headers/footers of the subsequent sections. When you convert the document to HTML, each section uses its own primary header/footer. But actually, only the first section in your document has primary header/footer.
Could you please describe how you would like we handle linked headers/footers upon converting to HTML? Your opinion will help us to improve our product. Thanks in advance for cooperation.
Best regards.
It would be nice to see the header at the top of the HTML document and the footer at the very bottom, as long as I use the “Link to Previous” option. (aka the footer would not appear until the last section that is linked to the previous one.) No other header / footer placement would be necessary. Ideally if html could be paginated, the header / footer would appear on each page. But sadly it is not.
Hi
Thank you for sharing your point of view. Your request has been linked to the appropriate issue. We will keep you informed regarding status of this issue and let you know once it is resolved.
Best regards,
Hello!
Thank you for your patience.
We have suggested a new option to output headers and footers in the described manner. In the very next version HtmlSaveOptions.ExportHeadersFootersMode will be introduced. Please set it to FirstSectionHeaderLastSectionFooter. Let us know if we can help further.
Regards,