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());
Conversion of attached .msg file (please unzip it first) ends up with creation of empty PDF file while message is correctly loaded to message variable.
We are using Aspose.Email.dll of version 188.8.131.52 and Aspose.Words.dll of version 184.108.40.206
Thanks in advance.
I have tested conversion of message with 17.2.0 version of Aspose.Email and Aspose.Words and still have the same issue. Please see my screenshot in attachment.
As you can see at the breakpoint position the message is loaded to the msgStream (it’s length is 1759 bytes), but document text contains “\r\f” only, while it must contain 1759 bytes of the text.
Have you used the same as ours code for testing? Possibly we have missed some options for Aspose.Words.LoadOptions?
Hope for your help.