Aspose.Words HTML have extra line space in Outlook when sent from draft

Dear Aspose,
Previously we have different font family issue in table with template when passing the Aspose saved HTML to Outlook with below options.

saveOptions = new Aspose.Words.Saving.HtmlSaveOptions
{
    ExportHeadersFootersMode = Aspose.Words.Saving.ExportHeadersFootersMode.None,
    Encoding = Encoding.Default,
    CssStyleSheetType = Aspose.Words.Saving.CssStyleSheetType.Inline,
    TableWidthOutputMode = Aspose.Words.Saving.HtmlElementSizeOutputMode.RelativeOnly
}

To resolve issue above, we change to CssStyleSheetType = Aspose.Words.Saving.CssStyleSheetType.Embedded

However, this create another issue which will cause extra line space between paragraph when sent from Outlook draft, the e-mail looks fine when in draft but once sent, it will have extra line space in recipient inbox’s e-mail. This extra line space issue didn’t happen when using CssStyleSheetType = Aspose.Words.Saving.CssStyleSheetType.Inline. Please provide a solution that able to resolve these two issues at the same time.

Aspose.Words version: 23.3.0.0

Thanks in advance.

@chanho Could you please attach your sample input and output documents here for our reference? We will check the issue and provide you more information.
Also, if I understand properly, the document looks fine when saved using Aspose.Words, the problem occurs after sending the output HTML as an e-mail message and viewing it in Outlook. So the problem might be causes by the tool you use to create mail message and sent it.

Sample file.zip (56.6 KB)

Hi, here’s the sample files @alexey.noskov

@chanho Thank you for additional information. As I can see after conversion to HTML, the output document looks the same with CssStyleSheetType.Embedded and CssStyleSheetType.Inline. So looks like the problem is caused not by Aspose.Words, but by the tool you use for sending mail message.

Hi @alexey.noskov, despite of that, while using CssStyleSheetType.Inline, the converted HTML able to show Paragraph & Table’s font-family correctly in Outlook e-mail. I tried few fonts, it works perfectly but when using ‘Verdana’ font-family to the Table in the word template, it’s not applying this font in Outlook e-mail. It feels strange, the ‘Verdana’ font-family works for the paragraph but not the Table.

@chanho Verdana font is applied as a default font in your input document. So in the output HTML it is applied on the body level:

<body style="line-height:11.5pt; font-family:Verdana; font-size:8.5pt">

The font should be inherited by all child elements in HTML and it does if view the document in the browser. Looks like after sending the e-mail Outlook does not follow the inheriting rules and applies some different style to the table.

Hi @alexey.noskov,

Is there any way to save the Word document as HTML while preserving the table styling, such as applying the font style using inline CSS for the table instead of inheriting it from the body level?

Thank you.

@EdmondMY CSS styles exported to output HTML depends on the styles and formatting applied to the document elements in the original document. If the default document font is applied to the text, it is inherited from the body element.