Hai,
I was trying to convert a docx file to html pages, when I am trying to convert each page of docx to seperate html files, html page is generatimg addtional pages at certain pages
file : SIGNALS & SYSTEMSS.docx (599.4 KB)
string path = @"D:\POC\kb pdfs";
Aspose.Words.Document docFile = new Aspose.Words.Document(@"D:\POC\kb pdfs\SIGNALS & SYSTEMSS.docx");
int pageCount = docFile.PageCount;
for (int page = 0; page < pageCount; page++)
{
using (MemoryStream pageStream = new MemoryStream())
{
// Save each page as a separate document.
Aspose.Words.Document extractedPage = docFile.ExtractPages(page, 1);
HtmlFixedSaveOptions htmlFixedSaveOptions = new HtmlFixedSaveOptions();
htmlFixedSaveOptions.ExportEmbeddedCss = true;
htmlFixedSaveOptions.ExportEmbeddedFonts = true;
htmlFixedSaveOptions.ExportEmbeddedImages = true;
htmlFixedSaveOptions.ExportEmbeddedSvg = true;
htmlFixedSaveOptions.ExportFormFields = true;
htmlFixedSaveOptions.ExportGeneratorName = true;
string cssprefix = "aspose_doc" + page;
htmlFixedSaveOptions.CssClassNamesPrefix = cssprefix;
htmlFixedSaveOptions.AllowEmbeddingPostScriptFonts = true;
//htmlFixedSaveOptions.UseTargetMachineFonts = true;
htmlFixedSaveOptions.SaveFormat = Aspose.Words.SaveFormat.HtmlFixed;
extractedPage.Save(Path.Combine(path, "convertedHtml", $"{ page + 1}.html"), htmlFixedSaveOptions);
}
}
check 38.html, it would have an additional page generated