Question

Does anyone know of an .eml to .pdf C# API?

Was it helpful?

Solution

Use OpenOffice (http://www.openoffice.org)

This will basically convert anything to PDF (doc, xls, ppt, txt). Since eml are just txt, why not just use this? See http://www.opendocument4all.com/download/OpenOffice.net.pdf for how to use OpenOffice in C#.

OTHER TIPS

We had a similar task, but on a much smaller scale and it was a temporary solution. We converted the EML files to HTML pages and then used the ABC Pdf component (I think they had a free version back then?) to create the PDF files out of the HTML pages. We did everything directly from the ASP.NET page.

When the Microsoft Outlook utility takes an e-mail message and saves it as a computer file, that message is typically stored in the MSG file format. A computer user would then traditionally need Microsoft Outlook, or a similar program capable of reading the MSG file format, to access the information contained within that file. Thankfully, users are no longer burdened with these kinds of restrictions. PST Viewer Pro is a utility that can successfully export an Outlook MSG file into a wide variety of different file formats based on your specific needs. For example, you can take an MSG file and convert it to Adobe’s popular PDF file format in just a few short mouse clicks.

Step 1

Highlight the directory where your MSG file is stored using the PST Viewer Pro “Explorer Tree.” The “Explorer Tree” is the name of the column that runs along the left side of the PST Viewer Pro program window. It is similar in appearance to a standard folder tree in Microsoft’s Windows Explorer. The contents of any directory that you select will be itemized and displayed in the “Mail List” at the top of the window.

Step 2

Click on the MSG file you wish to convert in the “Mail List.” The contents of any message you select will appear in the bottom portion of the mail list. Go through the MSG files you have selected until you find the one you want to convert.

Step 3

Select the appropriate PDF settings from the drop down menu at the top of PST Viewer Pro. There are seven total PDF settings that you can choose from including “PDF – attachments embedded,” “PDF – attachments converted/included,” “PDF – attachments saved to disk” and more. Make the appropriate selection based on your needs.

Step 4

Right-click on the MSG file in the “Mail List” and select the “Export” option. Note that you can also select the “Export” option from the “Export” drop down menu at the top of PST Viewer Pro. In addition, you can also press “CTRL” and “E” on your keyboard simultaneously. All three methods will open the window needed to convert the file.

Step 5

Click one time on the listing for the folder you want to use to save your PDF. You can also select the “Make a New Folder” button to create a new folder in the directory you’re currently viewing. Once you’ve made your selection, click “OK.” PST Viewer Pro will take the contents of the original MSG file and convert them to the PDF format based on your specifications.

You can check to make sure that the PDF conversion was successful by viewing the directory where you saved the file and opening it using a program like Adobe Reader. The converted PDF file can then be e-mailed in the form of an attachment to any recipient you choose. You can also backup the file to your hard drive or external USB flash drive for archival purposes as you deem necessary.

There are more tutorial for how to export eml files to pdf http://www.emlviewer.net/2012/08/eml-to-pdf.html

Couldn't you just print the file to pdf?

Edit: I guess what I'm saying is rather than looking for a .eml to .pdf conversion tool; you could look for a batch printing tool that can automate the printing of 100's or 1000's of .eml's. Then you just make the tool batch print to pdf.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top