Hello,
When converting a MSG to PDF the output PDF contains the images attachments in the PDF pages.
I used the code provided by you in the example: https://docs.aspose.com/email/net/saving-an-email-as-pdf/.
In Aspose.Email older versions this problem do not happen. Can you take a look please?
string dataDir = RunExamples.GetDataDir_KnowledgeBase();
MailMessage mailMsg = MailMessage.Load(dataDir + “message3.msg”);
MemoryStream ms = new MemoryStream();
mailMsg.Save(ms, Aspose.Email.SaveOptions.DefaultMhtml); // ← the problem seems to be here// create an instance of LoadOptions and set the LoadFormat to Mhtml
var loadOptions = new Aspose.Words.Loading.LoadOptions();
loadOptions.LoadFormat = LoadFormat.Mhtml;// create an instance of Document and load the MTHML from MemoryStream
var document = new Aspose.Words.Document(ms, loadOptions);// create an instance of HtmlSaveOptions and set the SaveFormat to Html
var saveOptions = new Aspose.Words.Saving.PdfSaveOptions();
document.Save(dataDir + “SaveEmailAsPDF_out.pdf”, saveOptions);
This issue can be reproduced in your online converter with the file I uploaded.
https://products.aspose.app/email/conversion/msg-to-pdf
MSG file with images attachements.zip (1.2 MB)
Thanks