Hi,
i try to convert an email to pdf. At first the email is saved in mhtml format via Aspose.Email.dll. After that the mhtml artefact is converted to pdf via Aspose.Words.dll.
The layout of the result document is corrupted. The grey box at the right side is to big, it squeezes the text to a very small margin at the left side.
I contacted the Aspose.Email team before and they told me, that the problem arises from the mhtml to pdf conversion. The mhtml file generated from Aspose.Email.dll is correct (see attachment).
Aspose.Email.dll 2.0.0.0
Aspose.Words.dll 11.6.0.0
internal bugid#4635
Thanks for help, Martin
==== Example code =================
public static void ConvertHtmlMail2Pdf(string strSourceFN)
{
string strTempFN = Path.GetDirectoryName(strSourceFN) + "\\" + Path.GetFileNameWithoutExtension(strSourceFN) + ".mht";
string strDestFN = Path.GetDirectoryName(strSourceFN) + "\\" + Path.GetFileNameWithoutExtension(strSourceFN) + ".pdf";
MailMessage mail = MailMessage.Load(strSourceFN);
MhtMessageFormatter mailFormatter = new MhtMessageFormatter();
mailFormatter.FromFormat = "Von: {0} "; //Wichtig: korrekte Anführungszeichen " benutzen
mailFormatter.DateTimeFormat = "dd.MM.yyyy HH:mm";
mailFormatter.SentFormat = "Gesendet: {0}";
mailFormatter.ToFormat = "An: {0}";
mailFormatter.SubjectFormat = "Betreff: {0}";
mailFormatter.BccFormat = "Bcc: {0}";
mailFormatter.CcFormat = "Cc: {0}";
mailFormatter.AttachmentFormat = "Anlagen: {0}";
mailFormatter.Format(mail);
mail.Save(strTempFN, MessageFormat.Mht, MailMessageSaveOptions.None);
LoadOptions loadOpt = new LoadOptions();
loadOpt.LoadFormat = LoadFormat.Mhtml;
Document wordDoc = new Document(strTempFN, loadOpt);
PdfSaveOptions saveOpt = new PdfSaveOptions();
wordDoc.Save(strDestFN, saveOpt);
}