Word to html header missing

source file

文档1-好莱客 (5).zip (256.7 KB)

File after conversion
页眉丢失.zip (9.5 KB)

@yanke1 This is an expected behavior. 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. In your case, however, the header is the first page header, so it is not exported to HTML. You can try changing ExportHeadersFootersMode to ExportHeadersFootersMode.FIRST_PAGE_HEADER_FOOTER_PER_SECTION to preserve the first section the first page header:

Document doc = new Document("C:\\Temp\\in.doc");
HtmlSaveOptions opt = new HtmlSaveOptions();
opt.setExportHeadersFootersMode(ExportHeadersFootersMode.FIRST_PAGE_HEADER_FOOTER_PER_SECTION);
doc.save("C:\\Temp\\out.html", opt);