This software can be used to convert eml files (emails as plain text in MIME format) to pdf files. It can be used as a library, command line tool or desktop application with its GUI.
The conversion is done by parsing (and cleaning) the mime/structure, converting it to html and then using wkhtmltopdf to convert the generated html to a pdf file.
It also handles inline images, corrupt mime headers and can use a proxy.
You can download the lates binaries here.
There you can find a Windows setup.exe and a jar.
If you want to use the jar (e.g. for a non Windows OS) you need the wkhtmltopdf binary in the PATH.
Usage: EMLtoPDFConverter [options] [eml-filename] Options: -d, --debug Debug mode Default: false -e, --error Display only Error messages. Default: false -a, --extract-attachments Extract Attachments. Default: false -ad, --extract-attachments-directory Extract Attachments to this Directory, if this option is not present the directory is besides the pdf as "-attachments". -?, --help Print this help. Default: false -hh, --hide-headers Do not add email headers (subject, from, etc.) at the beginning of the PDF document. Default: false -o, --output-filepath Filepath of the produced PDF document. If this option is ommited the PDF will be placed alongside the EML File. -p, --proxy Proxy (e.g. "http://10.64.1.74:81"). If "auto" is supplied the default system proxy will be used. -q, --quiet Do not display any messages at all. Default: false -gui, --show-graphical-user-interface Show graphical user interface (other parameters are ignored when using this switch). Default: false -v, --version Print the version number. Default: false
java -jar emailconverter-2.0.0-all.jar example.eml (you need wkhtmltopdf binary in the PATH)
How to build
You need to git clone this repository. The build will fail if you remove the .git folder (e.g. download this as zip from github).
Creates a single self contained Jar in
gradlew shadowJarbut additionally creates windows exe launchers in
build/libsfor gui and console mode. This task needs the Launch4j binary in the PATH.
Executes the unit tests and generates various reports (jacoco, checkstyle, findbugs, jdepend, unit test report).
The code is available under the terms of the Apache V2 License.