Can I print html files (with images, css) from the command-line?
You could give html2ps a try, it is written in Perl, so I guess it wil run on any operating system that runs Perl. It does support CSS and images. It does not render as good as you may perhaps want.
To use in Debian/Ubuntu sudo aptitude install html2ps
and then pipe the output to lpr
to print:
html2ps \
http://stackoverflow.com/questions/286583 \
|lpr
Or pipe the output to ps2pdf to convert to a pdf file:
html2ps \
http://stackoverflow.com/questions/286583 \
|ps2pdf - stackoverflow.pdf
You have a ton of options: html2ps, html2pdf, a huge list at: http://www.hypernews.org/HyperNews/get/www/html/converters.html
But personally I would recommend going with htmldoc it does postscript, PDF and is up to date (most recent release was <2 weeks ago. You'll need to use a tool like wget or elinks to actually download the HTML file and it's components.