Hi!
I'm using Aspose.Words (and Aspose.Email) to convert eml documents to images (jpg).
Here is my testing code:
Aspose.Words.Document doc;
var message = MailMessage.Load("AS.eml", MessageFormat.Eml);
message.PreferredTextEncoding = Encoding.UTF8;
using (var mhtStream = new MemoryStream())
{
message.Save(mhtStream, MailMessageSaveType.MHtmlFromat, MailMessageSaveOptions.WriteHeaderToMht);
doc = new Aspose.Words.Document(mhtStream);
}
int pageCount = doc.PageCount;
var imageSaveOptions = new Aspose.Words.Saving.ImageSaveOptions(Aspose.Words.SaveFormat.Jpeg);
imageSaveOptions.JpegQuality = 80;
imageSaveOptions.Resolution = 150;
imageSaveOptions.PageCount = 1;
for (int counter = 0; counter < doc.PageCount; counter++)
{
imageSaveOptions.PageIndex = counter;
doc.Save(string.Format("AS_{0}.jpg", counter.ToString()), imageSaveOptions);
}
And generally this works fine. But on the attached eml document the images are not generated correctly. If I use an older version of Aspose.Words (eg. 11.8) the image is correct. So I presume that it's a bug which was produced in the newer versions.
Regards,
Dejan