Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I need to be able to convert HTML email messages saved as text files (.eml or .msg) to PDF documents, one PDF per email, retaining formatting and images.

Are there any Linux tools that will allow me to do this from the command line (so it can be scripted)?

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

.eml files are just text files, so you can print them using standard methods.

The easiest utility for text conversion is arguably Pandoc. This utility should cover any html email as well, although you'll want to specify the format manually since .eml isn't very standard when it comes to text data.

pandoc -f html -o outputfile.pdf inputfile.eml

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.