[neomutt-users] Print html to pdf

Peter P. peterparker at fastmail.com
Fri Mar 20 18:28:04 CET 2020


* philipp at thumfart.info <philipp at thumfart.info> [2020-03-20 17:24]:
> Thanks, this looks promising for plain text mails, but does not solve my problem for with html e-mails.
> 
> --
> Mit freundlichen Grüßen
> With kind regards
> 
> Mag. Philipp S. Thumfart
> 
> On 20.03.2020 16:07, Peter P. wrote:
> > * Jakub Jindra <jakub.jindra at jakubjindra.eu> [2020-03-20 15:55]:
> > > 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.
> > muttprint?
You are correct Philipp, the html requirement escaped me. What I do is
display html emails in w3m inside mutt, then from within w3m I open that
html mail/file in firefox and print it from there to pdf using its gui.

Now I see that firefox also has a --headless flag and might be remote
controlled to print a page perhaps? Just guessing.
-------------- 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/1c01ab48/attachment.sig>


More information about the neomutt-users mailing list