Free Support Forum - groupdocs.com

Converting certain EML to HTML / PDF takes about half an hour in .NET

Converting the attached file to HTML with GroupDocs.Viewer or to PDF with GroupDocs.Conversion takes about half an hour to complete. Version 21.2 was used for testing (both).
The resulting HTML/PDF file looks fine, it’s just the long conversion time that’s problematic for such a small file.
It’s probably related to the embedded images which cannot be loaded.

eml conversion time.zip (24.3 KB)

Hi @Clemens_Pestuka

Could you provide the source code that used for conversion?

@mikhail.evgrafov.aspose
sure, but it was just a basic conversion, nothing special.

Viewer:

        using (var viewer = new Viewer(documentPath))
        {
            var options = ViewOpts.HtmlViewOptions.ForEmbeddedResources("output_viewer{0}.html");
            viewer.View(options);
        }

Conversion:

        using (var converter = new Converter(documentPath))
        {
            var options = new ConvOpts.PdfConvertOptions();
            converter.Convert("output.pdf", options);
        }

Hi @Clemens_Pestuka

We could reproduce this issue at our end. It’s been logged in our internal issue tracking system with ID VIEWERNET-3129. As there’s any update, you’ll be notified.

1 Like

Hi @Clemens_Pestuka

I have investigated this file - it contains many invalid links. Files exist for these links, but with the wrong content-type format.
For example:
https://www.nespresso.com/emailing/NespressoVisuals/common/temp_2020/logo-light.jpg - resource exists, but it’s not JPEG, it’s actually WEBP. So outlook and Viewer unable to handle it correctly, because of the wrong content type (JPEG, but actually is WEBP) returned by server www.nespresso.com.
We fixed long rendering (we will provide code for you), the fix will be in the current release (21.3). But because of these invalid links, links resources will not be visible (as it not visible in Outlook too).

1 Like

@mikhail.evgrafov.aspose

Thanks for the quick and detailed answer!
I understand that the images cannot be viewed because of the wrong content type.
As long as the conversion time is fixed in 21.3, I am happy :smiley:
Thank you :slight_smile:

@Clemens_Pestuka

GroupDocs.Viewer for .NET v21.3 that includes fix for this issue has been published. You can find the new version at

Have a nice day!

1 Like

Hi @Clemens_Pestuka

To set load resources timeout and prevent long rendering please use the following code:

 HtmlViewOptions viewOptions = HtmlViewOptions.ForEmbeddedResources("result_{0}.html");
 LoadOptions loadOptions = new LoadOptions();
 loadOptions.ResourceLoadingTimeout = TimeSpan.FromSeconds(1);

 using (Viewer viewer = new Viewer(documentPath, loadOptions))
 {
      viewer.View(viewOptions);
 }
1 Like

@mikhail.evgrafov.aspose

Thanks a lot for the very fast fix :+1:
I can confirm that it’s working fine with this code and the latest version.

@Clemens_Pestuka

You’re welcome!