[neomutt-users] Print html to pdf

Jakub Jindra jakub.jindra at jakubjindra.eu
Fri Mar 20 15:52:17 CET 2020


Hi Philipp,

I have following script for printing to PDF:

#!/usr/bin/env sh
OPEN_PDF="open -a Preview"

tmpfile=$(mktemp)
perl -pe 's/\e\[[\d;]*m//g;' | \
	iconv -f utf-8 -t iso-8859-2 -c | \
	a2ps -B -X iso2 -o - | \
	ps2pdf - $tmpfile

$OPEN_PDF $tmpfile
sleep 1
rm $tmpfile
#### END

set print_command = "/path/to/the/script/above.sh"

Change OPEN_PDF command to suit your needs.
You need perl, iconv, a2ps and ghostscript.

To create PDF with with all headers run before printing.
:unset weed

My PDFs are quite ugly. If anyone has prettier way I would also like to see it.

Best,
Jakub

On 2020-03-20 15:08, philipp at thumfart.info wrote:
> Hey everybody!
> 
> I was wondering if there is currently a way to print plain text e-mails to pdf?
> 
> Furthermore, is it possible to print html e-mails (including their header information)?
> 
> Thanks in advance!
> 
> --
> Mit freundlichen Grüßen
> With kind regards
> 
> Mag. Philipp S. Thumfart
> 



-- 
Jakub Jindra
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://mailman.neomutt.org/pipermail/neomutt-users-neomutt.org/attachments/20200320/03e65a2c/attachment.sig>


More information about the neomutt-users mailing list