Free Support Forum - aspose.com

How to export all pages and headers/footers to HTML?

Hi!


In Word, you can insert a header/footer in any page, which then will be used for all pages. For example to show page numbers. I cannot find any features to export all these correctly.I have noticed that you mention it beeing “wrong” in HTML. But at least i expect an export to show everything written in the document.

Tips on how i can achieve this?

Example document is attached.

Hi,


Thanks for your inquiry. Yes, it is hard to meaningfully output content of headers and footers to HTML because HTML is not paginated. I would suggest you please read the following API page on the ExportHeadersFootersMode Enumeration:
http://www.aspose.com/docs/display/wordsnet/ExportHeadersFootersMode+Enumeration

Please let me know if I can be of any further assistance.

Best Regards,

I tried solving this by using DocumentBuilder and looping through all headers/footers,i can get the content of for example the headers, and i can move the builder to the location of the header. I then do a builder.addHTML(headerNote.getText()). In the document i work with, this works, but upon saving it as HTML, the content disappears.


Any suggestions? :slight_smile:


Hi,


Thanks for the additional information. Sure, you can build Headers/Footers content using Aspose.Words; but, you should not that not all Microsoft Word document features are available in HTML formats and some features may be lost. You can confirm this by converting the Word document you attached in your first post to HTML format by using Microsoft Word itself. It doesn’t export Headers/Footers too.

Best Regards,