How to print an email to pdf programmatically [closed] Code Answer

Hello Developer, Hope you guys are doing great. Today at Tutorial Guruji Official website, we are sharing the answer of How to print an email to pdf programmatically [closed] without wasting too much if your time.

The question is published on by Tutorial Guruji team.

I want to generate a PDF document from a “raw” email. This email could containt html or just text. I don’t care for attachments.

The resulting pdf should contain the proper formatting (from css and html) and also embedded images.

My first idea was to render the email using an email client like thunderbird and then print it to pdf. Does thunderbird offer such an API or are there java libraries available to print an email to pdf?

Answer

I put a piece of software together that converts eml files to pdf’s by parsing (and cleaning) the mime/structure, converting it to html and then use wkhtmltopdf to convert it to a pdf file.

It also handles inline images, corrupt mime headers and can use a proxy.

The code is available at github under apache V2 license.

We are here to answer your question about How to print an email to pdf programmatically [closed] - If you find the proper solution, please don't forgot to share this with your team members.

Related Posts

Tutorial Guruji