Thanks for your inquiry. You can use HtmlSaveOptions.ExportHeadersFootersMode property specify how headers and footers are output to HTML, MHTML or EPUB. Default value is PerSection for HTML/MHTML and None for EPUB.
It is hard to meaningfully output headers and footers to HTML because HTML is not paginated. When this property is PerSection, Aspose.Words exports only primary headers and footers at the beginning and the end of each section. When it is FirstSectionHeaderLastSectionFooter only first primary header and the last primary footer (including linked to previous) are exported. You can disable export of headers and footers altogether by setting this property to None.
In your case you need to export first page header and footer to HTML. Hope, this helps.
Thanks for your inquiry. In your “Letter - Logo.doc document”, there is one “Primary Header” and one “First Page Header”. The picture is contained inside first page header. Now, you need to run the following code to be able to export it to HTML (see attached 16.1.0.zip):
Document doc = new Document(MyDir + @"Letter±+Logo.doc");
HtmlSaveOptions opts = new HtmlSaveOptions(SaveFormat.Html);
opts.ExportHeadersFootersMode = ExportHeadersFootersMode.FirstPageHeaderFooterPerSection;
doc.Save(MyDir + @"16.1.0.html", opts);
We can offer you another solution i.e. converting the Word document to the HTML format using absolutely positioned elements (HtmlFixed) produces the expected output. Here is how you can use HtmlFixedSaveOptions to get output in HtmlFixed save format and perhaps, you will be satisfied with HTML Fixed format (see attached 16.1.0-HtmlFixed.zip).
Document doc = new Document(MyDir + @"Letter+-+Logo.doc");
HtmlFixedSaveOptions option = new HtmlFixedSaveOptions();
option.SaveFormat = SaveFormat.HtmlFixed;
doc.Save(MyDir + @"16.1.0-HtmlFixed.html", option);
We were also not able to get correct output when saving this ‘Synopsis.docx’ document to plain HTML format by using MS Word 2016 on our end. So, this seems to be an expected behavior. Instead, we suggest you please try saving to HtmlFixed format. Please see aw-msw-outputs.zip (149.0 KB)