Hi,
Context:
I want to convert an EML to a PDF.
I followed Exporting EML to PDF - #2 by awais.hafeez, which advises to:
-
convert from EML to MHTML with Aspose.Email
-
convert from MHTML to PDF with Aspose.Words
The code is the following:
MemoryStream ms = new MemoryStream();
emlMessage.Save(ms, Aspose.Email.SaveOptions.DefaultMhtml);
// Convert MHTML as word doc
Aspose.Words.Loading.LoadOptions lo = new Aspose.Words.Loading.LoadOptions();
lo.LoadFormat = Aspose.Words.LoadFormat.Mhtml;
Aspose.Words.Document document = new Aspose.Words.Document(ms, lo);
// Convert Word Doc as PDF
Aspose.Words.Saving.PdfSaveOptions saveOptions = new Aspose.Words.Saving.PdfSaveOptions();
document.Save(fileStream, saveOptions);
Problem: I want to customize the formatting of the email information. For instance, I want the From field not to be formatted as such:
From: Quentin PERGELINE
But rather:
From: Quentin PERGELINE<quentin.pergeline@iwecloud.com>
As an example:
the EML: source.eml
the converted PDF: dest.pdf
Question: How can I customize the formatting of email info (especially the From field) during the conversion from an EML to a PDF?
Thanks
example.zip (273.6 KB)