.NET Conversion from RTF/DOCX to PDF exception inside Docker on Alpine Linux

Hi @Atir_Tahir, may I know if you have an update? Thank you.

@smauro

Your ticket is still under investigation. We’ll notify you in case of any update.

Hi @atir.tahir, our stakeholders would like to know if there’s an update. Thank you.

@smauro

Your ticket is still under investigation. As soon as we have any updates, we’ll provide an ETA.

sample (no license included).zip (819.0 KB)
Hi @atir.tahir,

Our client encountered an error “Cannot access a closed stream” converting a MSG file with attachment to pdf. rtf, docx, pptx, xlsx works fine. I have attached a sample. Thank you.

1 Like

@smauro

We’ll continue investigation.

Hi @atir.tahir, can I get an update regarding the recent issue? Thank you.

@smauro

Your ticket is still under investigation.

@smauro

There’s some issues with the implementation (the code that you shared). Please try the following implementation for your TestConvert method:

//C# code
private void TestConvert(Result result, string filename)
{
    Converter converter = new Converter(() => new MemoryStream(result.Content));

    using (var outputStream = new MemoryStream())
    {
        PdfConvertOptions options = new PdfConvertOptions();

        converter.Convert(() => new MemoryStream(), (convertedStream, sourceName) => { convertedStream.CopyTo(outputStream); }, options);

        result.Content = outputStream.ToArray();
    }
}

Please note that the msg format is a “container” format (e.g. can contain attachments). In this regards the conversion is executed for the email message itself and for each attachment. In the current scenario, the email itself is also converted, but after that, the attachment is converted and stored to result.Content. This effectively swallows the email conversion to pdf and only the attachment is returned. If the email has several attachments, only the last one will be returned as pdf in this implementation.

1 Like

We will test. Thank you @atir.tahir

@smauro

You are welcome.

Hi @atir.tahir, can we have the following options if user chooses one?

  1. How can we show the email itself and the attachments together, if possible? (in a single pdf file)
  2. How can we show the email only?

Thank you.

@smauro

Can you provide additional information? Are you inquiring about the conversion of emails and attachments, or do you need a document viewer that displays emails and attachments concurrently? Is GroupDocs.Viewer for .NET being utilized in your application?

Hi @atir.tahir, yes, I am inquiring about the conversion of emails and attachments.

And having the options to convert:

  1. email only and not including the attachments if there is any
  2. email and attachments all in one page

Thank you.

1 Like

@smauro

We are investigating these options. Your investigation ticket ID is CONVERSIONNET-5889. We’ll notify you in case of any update.

Hi @atir.tahir, we’d like to follow through on our recent inquiry. Thanks!

1 Like

@smauro

In EmailLoadOptions set ConvertOwned to false.
Take a look at the following API references:

This is not possible using Conversion API.

Hi @atir.tahir, Email attachments can be more important than the email itself. Before we start exploring our own implementation, I’m wondering if there is any API under the GroupDocs umbrella that we can utilize for this requirement as we really need to convert and combine the email and its attachments in one PDF.

@dmcintyreiqx

The workaround is, you can use GroupDocs.Conversion for Email and attachments conversion. Later, you can merge the outputs (both email output and attachment output) using GroupDocs.Merger API.

Hi @atir.tahir,

Do you have any updates in relation to error we are getting in the windows docker container?
Would appreciate some updates and ETA on this as we have customers running windows containers.

Regards,
Duncan McIntyre