Aspose.Words to render single-page HTML

We are currently using Aspose.Words to generate PDF, using SaveFormat.Pdf. Now we have the need to render the same contents as HTML. SaveFormat.HtmlFixed seems to allow us to do this, but there are some things that do not meet the requirements perfectly.

When the contents is multiple pages with a first-page footer in PDF, is it possible to render it as a single page HTML and have the first-page footer show up once at the end of the content? Right now, the first-page footer is showing up in the middle of a 2-page contents (at the end of “page 1”). We are hoping that we could remove the concept of pages, so that we’d have one footer at the end.

@syamamoto You can try using the following code:

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

PageSetup pageSetup = doc.FirstSection.PageSetup;
double pageContentHeight = pageSetup.PageHeight - pageSetup.TopMargin - pageSetup.BottomMargin;

// Check whether document fits one page. If not increase page height.
while (doc.PageCount > 1)
{
    double addition = doc.PageCount > 2 ? (doc.PageCount - 1) * pageContentHeight : 10;
    pageSetup.PageHeight = pageSetup.PageHeight + addition;
    doc.UpdatePageLayout();
}

doc.Save("C:\\Temp\\out.html", SaveFormat.HtmlFixed);

But, please note, the maximum height of page in MS Word is 1584pt, so you cannot set page height beyond this value using Aspose.Words.