Convting Word to HTML Header is missing

Hi team,
I am converting word to HTML using aspose .After conversion header is coming at the first page and footer is showing at last page of html.
I want to get header and footer is show in html page wise(as per word document).
In this attach word document page no is set in footer and it’s come at the last . I want that page number come at each page in HTML.

Aspose.Words.License licWord = new Aspose.Words.License();
string strLicenscePath = "D:\\Aspose.Words.lic";
licWord.SetLicense(strLicenscePath);

Aspose.Words.Saving.HtmlSaveOptions options1 = new Aspose.Words.Saving.HtmlSaveOptions(Aspose.Words.SaveFormat.Html);
options1.ExportImagesAsBase64 = true;

Aspose.Words.Saving.HtmlSaveOptions options = new Aspose.Words.Saving.HtmlSaveOptions(Aspose.Words.SaveFormat.Html)
{
    ExportImagesAsBase64 = true,
    ExportXhtmlTransitional = true,
    Encoding = System.Text.Encoding.UTF8,
    //ExportHeadersFootersMode = Aspose.Words.Saving.ExportHeadersFootersMode.PerSection,
    ExportHeadersFootersMode = ExportHeadersFootersMode.PerSection,
    ExportPageMargins = true,
    ExportPageSetup = true,
    UseHighQualityRendering = true,
    //ExportFontResources = true,
    //ExportFontsAsBase64 = true,
    //options.ExportRelativeFontSize = true,
    ResolveFontNames = true,
    AllowEmbeddingPostScriptFonts = true,
    PrettyFormat = true,
    SaveFormat = SaveFormat.Html,
    ExportTocPageNumbers = true,
    ExportDocumentProperties = true,
    CssStyleSheetType = CssStyleSheetType.Inline,
    ExportRoundtripInformation = true,

};
var wordloadoption = new Aspose.Words.Loading.LoadOptions() { LoadFormat = LoadFormat.Docx };
byte[] bytesectionData;
bytesectionData = File.ReadAllBytes(@"D:\\Testing.docx");
Aspose.Words.Document doc = new Aspose.Words.Document(new MemoryStream(bytesectionData), wordloadoption);
//Aspose.Words.Document doc = new Aspose.Words.Document(Content, wordloadoption);
doc.FontInfos.EmbedTrueTypeFonts = true;
doc.FontInfos.EmbedSystemFonts = true;
doc.FontInfos.SaveSubsetFonts = true;
doc.Save("D:\\output.html", options);

Attach File
Testing.docx (61.1 KB)

output.zip (26.0 KB)

FooterIssue.png (294.4 KB)

Testing.png (156.0 KB)

@Jayshiv If you need that the resulting HTML looks exactly the same as the document looks in MS Word, you can consider using HtmlFixed instead of flow HTML:

Document doc = new Document(@"C:\Temp\in.docx");

HtmlFixedSaveOptions opt = new HtmlFixedSaveOptions();
opt.ExportEmbeddedCss = true;
opt.ExportEmbeddedFonts = true;
opt.ExportEmbeddedImages = true;
opt.ExportEmbeddedSvg = true;

doc.Save(@"C:\Temp\out.html", opt);

When you save the document with HtmlFixedSaveOptions the document is rendered and look the same as it look if you save it to PDF or XPS using Aspose.Words. HtmlFixed format is good for viewing document, but it does not preserve original internal document structure and cannot be converted back to DOCX.

@alexey.noskov Thanks for your quick response.
I am aware of HtmlFixed but in that I am facing issue in table formate .
After using HtmlFixed my table is converted into div and span but I want it as table.
Is there any way to convert that div span structure to Table structure.After that I can use HtmlFixed .

@Jayshiv No, unfortunately, there is no way to export table as table into HtmlFixed format. The format is not intended to preserve original document structure, it is designed to preserve original document layout.

@alexey.noskov Thanks,
Please let me know if something update related to this.

@Jayshiv As a workaround, you can split your document page by page and export each page to HTML. In this case header/footer will be exported for each page to HTML. You can use Document.ExtractPages method to achieve this.