We’re trying to convert a specific .msg to pdf, but some of the email body is removed from the converted document. The .msg email is a quite simple one with some text and hyperlinks.
We’re using latest version 23.5 with the following code:
Aspose.Email.MailMessage emailDoc = Aspose.Email.MailMessage.Load(filename);
MemoryStream htmlStream = new MemoryStream();
MhtSaveOptions mhtSaveOptions = new MhtSaveOptions()
{
CheckBodyContentEncoding = true,
PreserveOriginalBoundaries = true,
MhtFormatOptions =
MhtFormatOptions.WriteHeader |
MhtFormatOptions.WriteCompleteFromEmailAddress |
MhtFormatOptions.WriteCompleteToEmailAddress |
MhtFormatOptions.WriteCompleteCcEmailAddress |
MhtFormatOptions.WriteCompleteBccEmailAddress |
MhtFormatOptions.HideExtraPrintHeader |
MhtFormatOptions.RenderVCardInfo
};
emailDoc.Save(htmlStream, mhtSaveOptions);
Aspose.Words.Loading.LoadOptions loadOptions = new Aspose.Words.Loading.LoadOptions()
{
LoadFormat = Aspose.Words.LoadFormat.Mhtml,
};
var wordDoc = new Aspose.Words.Document(htmlStream, loadOptions);
foreach (Aspose.Words.Tables.Table table in wordDoc.GetChildNodes(NodeType.Table, true))
table.AutoFit(AutoFitBehavior.AutoFitToWindow);
var saveOptions = new Aspose.Words.Saving.PdfSaveOptions() { };
wordDoc.Save(dstFilename, saveOptions);
Document to reproduce problem inside zip here:
MissingTextProblem.zip (15.7 KB)
MissingTextProblem.zip (15.7 KB)