0
I have an email message in my IMAP inbox. It's HTML email that makes use of fonts, tables, images and such. How do I convert this email message into a PNG image that looks reasonably close to what I see in my email program?
I can almost accomplish what I want by printing to PDF in my email program and then using pdftoppm -png to convert it to PNG. However, the PDF has page margins that the original email doesn't have. Also, pdftoppm produces one PNG per page whereas I'd like to have the entire email in one PNG with no page breaks.
Taking a screenshot isn't an option because the email is very long.
Since HTML email is basically HTML, is there some method that involves getting the raw HTML out of the message and piping it to some kind of WebKit-based rendering tool?
ooh. is email a standard python module you'd find or does it need an additional package? – Journeyman Geek – 2017-04-15T22:50:47.663
It's standard: https://docs.python.org/3/library/email-examples.html Quite big and hard to understand, but there are lots of examples on Stack Overflow and elsewhere :) I tried to find a ready-made command-line tool to convert .eml to .html but couldn't.
– Lassi – 2017-04-17T08:32:36.143