Generating images from eml

Hello!

I’m using Aspose Words for creating images from eml files. But the country specific characters in the “From” or “To” field of the email are not displayed correctly in the output image. Here is my code:

1. Creating a document object from the eml file:
var options = new MailMessageLoadOptions { MessageFormat = MessageFormat.Eml };
var message = MailMessage.Load(inputStream, options);
message.PreferredTextEncoding = Encoding.Unicode;
message.SubjectEncoding = Encoding.Unicode;
message.BodyEncoding = Encoding.Unicode;
message.TimeZoneOffset = TimeZoneInfo.Local.BaseUtcOffset;

using (var mhtStream = new MemoryStream())
{
message.Save(mhtStream, MailMessageSaveType.MHtmlFormat, MailMessageSaveOptions.WriteHeaderToMht);
doc = new Aspose.Words.Document(mhtStream, new Aspose.Words.LoadOptions(Aspose.Words.LoadFormat.Mhtml, “”, “”));
}

2. Creating images from the document object:
var imageSaveOptions = new Aspose.Words.Saving.ImageSaveOptions(Aspose.Words.SaveFormat.Jpeg);
imageSaveOptions.JpegQuality = 150;
imageSaveOptions.Resolution = configElLarge.Dpi;
imageSaveOptions.PageCount = 1;

for (int counter = startPage; counter < endPage.Value; counter++)
{
imageSaveOptions.PageIndex = counter;
var imageStream = new MemoryStream();
doc.Save(imageStream, imageSaveOptions);
}

Please check and let me know if I’m doing someting wrong. You can find attached an example of the eml file and an image of the problem.

Best regards,
Dejan

Hi Dejan,

Problem occurs during EML to MHTML conversion. We are further investigating the issue and will share a solution with you as soon as possible.

Best Regards,

Hi Dejan,


I have tested the conversion from EML to MHTML, and observed that From field is not converted properly. This issue is logged in our bug tracking system under Id:EMAILNET-34801 for further investigation by the development team. I shall write here as soon as some feedback is received in this regard.

The issues you have found earlier (filed as EMAILNET-34801) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.