Docx to HTML formatting question

I’m using the trial version and trying to convert a docx file to HTML.
The line height is off and the indents are missing.
Are there some options that I’m missing?

Hi Gary,
Can you please share your input Word document to reproduce the issue?
Best Regards,

Attached.

And my code below.

static void ExportHTML(string srcFile, string path)
{
    var doc = new Document(srcFile);
    HtmlSaveOptions saveOptions = new HtmlSaveOptions();
    saveOptions.DocumentSplitCriteria = DocumentSplitCriteria.PageBreak;
    saveOptions.SaveFormat = SaveFormat.Html;
    string outFile = srcFile.Replace("docx", "html");
    doc.Save(outFile, saveOptions);
}

Hi Gary,
Sorry, I was not able to notice any difference in the output HTML using the latest version of Aspose.Words for .NET. Can you please share a screenshot to highlight the issue?
Best Regards,

Hi Gary,
This is expected behavior as MS Word also produces the same output. You can follow https://docs.aspose.com/words/net/applying-formatting/ to update paragraph formatting or page setup and get your desired result.
Best Regards,

I’m not sure how that applies. I’m not building a document object, I’m converting an existing document to HTML using document.Save with the SaveFormat set to HTML.

The spacing also seems to differ between browsers, i.e. it looks different in Chrome and various flavors of IE.

Hi Gary,
In your case, you can save your document to Html_Fixed format e.g.
doc.Save(“SunTrust_GreatDayatWork_Email_Content_v2.1-1.html”, SaveFormat.HtmlFixed);
Best Regards,

I get “An invalid SaveFormat for this options type was chosen.”

HtmlSaveOptions saveOptions = new HtmlSaveOptions();
saveOptions.DocumentSplitCriteria = DocumentSplitCriteria.PageBreak;
saveOptions.SaveFormat = SaveFormat.HtmlFixed;
string outFile = srcFile.Replace(extension, ".html");
doc.Save(filesDir + "/" + outFile, saveOptions);

Hi Gary,
You cannot use HtmlSaveOptions with HtmlFixed format. Please use HtmlFixedSaveOptions as you can see in the following example.

HtmlFixedSaveOptions saveOptions = new HtmlFixedSaveOptions();
saveOptions.PageCount = 1;

for (int i = 0; i < doc.PageCount; i++)
{
    saveOptions.PageIndex = i;
    doc.Save(@"SunTrust_GreatDayatWork_Email_Content_v2.1-1_Page" + (i + 1) + ".html", saveOptions);
}

Best Regards,