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?