Search code examples
c#exchangewebservicesexchange-server-2010

Save EmailBody as PDF file using EWS API


I'm using Exchange Web Services Managed API 2.0 to connect to Exchange server 2010. I wanted to download email body to a PDF file in a folder on the disk.

I do not want to use any paid third party to integrate.

Any help will be appreciated.


Solution

  • PdfSharp is a great free library for creating and manipulating PDFs. See this answer, it should set you in the right direction.

    Edit: Seems like PdfSharp doesn't actually provide an option to convert an HTML to PDF. I have since explored different libraries. I found that ChromeHtmlToPdf is a good free alternative and easy to use. Bear in mind that it uses Chrome to work it's magic.