Error converting eml and msg files to pdf

Hi Support Team,

I am using GroupDocs.Conversion .NET to convert files to PDF. In most cases this works fine. But when trying to convert eml and msg files i get the following error message:
“Resource loading timeout 20000 s”
Since the conversion is part of a bigger project, i have tested the code isolated in a new test project. There it seems to be working fine. But the same code in the big project does not work.

Func<LoadContext, LoadOptions> loadOptions = loadContext =>
{
    if (inputFilePath.EndsWith(".eml"))
    {
        var emailoptions = new EmailLoadOptions
        {
            ResourceLoadingTimeout = TimeSpan.FromMilliseconds(60000),
            Format = EmailFileType.Eml
        };
        return emailoptions;
    }
    return null;
};

var options = new PdfConvertOptions();
options.PdfOptions.PdfFormat = PdfFormats.PdfA_3B;

using (Converter converter = new Converter(inputFilePath, loadOptions))
{
    converter.Convert(outputFilePath, options);
}

As you can see i have also tried to modify the ResourceLoadingTimeout. But the error message stays the same no matter what i do. If i catch the error in the convert function it only shows the above message. I unfortunately can’t get any more information on the problem and have not found any solution online. Here is a file i have tested it with.
sample.7z (1,5 KB)
Any suggestions on how i can fix this problem? The same problem happens when trying to convert a .msg file. I used the same code, only the filetype and the extension changed.

Thank you for your help.

@NeoTS

It seems you are encountering a “Resource loading timeout” error when trying to convert EML and MSG files to PDF using the GroupDocs.Conversion library in your larger project. This issue may arise due to various factors, especially if the same code works in a separate test project.

Here are some suggestions to help you troubleshoot and potentially resolve the issue:

  1. Increase Resource Loading Timeout: You mentioned that you set the ResourceLoadingTimeout to 60 seconds. Ensure that this setting is correctly applied in your main project. You might want to try increasing the timeout even further to see if that resolves the issue.

  2. Check for Resource Availability: The error could indicate that the conversion process is trying to access resources (like images or attachments) that are not available or are taking too long to load. Ensure that all resources referenced in the EML or MSG files are accessible and not blocked by any security settings.

  3. Isolation of Dependencies: Since the code works in a test project, check if there are any differences in the environment or dependencies between the two projects. Ensure that the same version of the GroupDocs.Conversion library is being used in both projects.

  4. Logging and Debugging: Implement logging in your conversion process to capture more detailed error messages or stack traces. This can help identify where the timeout is occurring.

  5. Review Similar Issues: There have been reports of incomplete conversions for specific EML files, which might indicate underlying issues with certain file formats. You can refer to discussions on similar problems to see if there are any workarounds or fixes available.

  6. Contact Support: If the issue persists, consider reaching out to GroupDocs support with detailed information about your project setup, the specific files causing issues, and any logs you have collected. They may have insights or updates regarding known issues.

If you need further assistance, feel free to ask!

Sources:
[1]: Issue with Incomplete EML to PDF Conversion

Hello @NeoTS ,

Thank you for sharing the details and the sample file. While the code you are using to convert .eml to .pdf appears to be correct, we cannot provide an instant solution at this time. As such, we have opened ticket CONVERSIONNET-7436 in our system to analyze your specific case. We will update you as soon as we have more information on the issue.