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)