I have a msg file. I can convert msg file correctly to mhtml file. After that i convert mhtml to Pdf
using Aspose.Words. (With full licence)
First problem :
Embedded image is not shown on pdf file (but its shown on mhtml file(attached))
How can i fix this ?
Here is the code :
string fileName = openFileDialog1.FileName;
var message = Aspose.Email.Mail.MailMessage.Load(fileName);
using (var msgStream = new MemoryStream())
{
message.Save(msgStream, Aspose.Email.Mail.MailMessageSaveType.MHtmlFromat);
message.Save("c:\\test.mhtml", Aspose.Email.Mail.MailMessageSaveType.MHtmlFromat);
msgStream.Position = 0;
var options = new Aspose.Words.LoadOptions();
options.LoadFormat = Aspose.Words.LoadFormat.Mhtml;
var document = new Aspose.Words.Document(msgStream, options);
foreach (Aspose.Words.Tables.Table table in document.GetChildNodes(NodeType.Table, true))
{
//table.PreferredWidth = PreferredWidth.FromPercent(100);
table.PreferredWidth = PreferredWidth.FromPercent(100);
}
string path = "c:\\test.pdf";
document.Save(path, new Aspose.Words.Saving.PdfSaveOptions());