Hello,
We are using next code for conversion of .msg files to PDF:
var message = Aspose.Email.Mail.MailMessage.Load(inputFilePath);
using (var msgStream = new MemoryStream())
{
message.Save(msgStream, new Aspose.Email.Mail.HtmlSaveOptions());
msgStream.Position = 0;
var options = new Aspose.Words.LoadOptions
{
LoadFormat = Aspose.Words.LoadFormat.Mhtml,
Encoding = Encoding.UTF8
};
var document = new Aspose.Words.Document(msgStream, options);
document.Save(outputFilePath, new Aspose.Words.Saving.PdfSaveOptions());
}
The result pdf file contains the html markup instead of presenting e-mail content. See the source and result files in attachment.
We are using Aspose.Email.dll of version 17.2.0.0 and Aspose.Words.dll of version 17.2.0.0.
Thanks in advance.
Valeriy
We are using next code for conversion of .msg files to PDF:
var message = Aspose.Email.Mail.MailMessage.Load(inputFilePath);
using (var msgStream = new MemoryStream())
{
message.Save(msgStream, new Aspose.Email.Mail.HtmlSaveOptions());
msgStream.Position = 0;
var options = new Aspose.Words.LoadOptions
{
LoadFormat = Aspose.Words.LoadFormat.Mhtml,
Encoding = Encoding.UTF8
};
var document = new Aspose.Words.Document(msgStream, options);
document.Save(outputFilePath, new Aspose.Words.Saving.PdfSaveOptions());
}
The result pdf file contains the html markup instead of presenting e-mail content. See the source and result files in attachment.
We are using Aspose.Email.dll of version 17.2.0.0 and Aspose.Words.dll of version 17.2.0.0.
Thanks in advance.
Valeriy