Hi @Atir_Tahir, may I know if you have an update? Thank you.
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.
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.
Hi @atir.tahir, can we have the following options if user chooses one?
- How can we show the email itself and the attachments together, if possible? (in a single pdf file)
- How can we show the email only?
Thank you.
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:
- email only and not including the attachments if there is any
- email and attachments all in one page
Thank you.
We are investigating these options. Your investigation ticket ID is CONVERSIONNET-5889. We’ll notify you in case of any update.
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.
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