Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Mon Aug 19, 2024 2:28 pm

Hi,

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

profiler007
 
Posts: 73
Joined: Wed Nov 13, 2019 11:32 am

Tue Aug 20, 2024 7:46 am

Hello,

Thank you for your inquiry. I used the latest version (Spire. Officefor. NETStandard. 9.6.0) to convert your docx document into an HTML document and did not encounter the null reference exception you described. However, I reproduced the image blur issue you raised and recorded it in our bug tracking system under the number SPIREDOC-10775.Our Dev team will investigate and optimize it further, once there is any update, we will let you know.
As for "null reference exception", you can upgrade to the latest version and try again.

Sincerely,
Amin
E-iceblue support team
User avatar

Amin.Gan
 
Posts: 164
Joined: Mon Jul 15, 2024 5:40 am

Return to Spire.PDF

cron