our clients are complaining about blurry images in the emails they send. In our code, we convert docx files to HTML and then use it as the body of an emails. Here is the code we use:
- Code: Select all
using (var doc = new Document())
{
var docName = Path.GetFileNameWithoutExtension(pathToDoc);
doc.LoadFromFile(pathToDoc);
doc.ViewSetup.DocumentViewType = DocumentViewType.WebLayout;
//Set whether the css styles are embeded or not.
doc.HtmlExportOptions.CssStyleSheetType = CssStyleSheetType.Internal;
//Set whether the images are embeded or not.
doc.HtmlExportOptions.ImageEmbedded = true;
doc.SaveToFile(tempLocation, FileFormat.Html);
}
Attached you can find some of the documents and the resulting html files.
We got a null reference exception during the conversion for blurry image 5.docx.
P.S. We use 'Spire.Officefor.NETStandard.9.4.0'.
Any ideas and suggestions on how to improve the image quality are welcome.
Regards