[cups.general] print rendered HTML via CLI

Nathan Wheeler nahun at nahun.ath.cx
Fri Jun 15 12:27:38 PDT 2007

I've tried HTMLDOC and html2ps, but neither support CSS, images (or 
other more complicated sites) very well. I should have mentioned that in 
my first post. What would be perfect is if there was a command with 
Firefox to print a file like using openoffice's `soffice -p`. Any 
browser really except IE obviously :P Opera has some command line 
options, but none to print. I guess I'm probably stuck with converting 
to PS or PDF.

Thanks Kurt!

Kurt Pfeifle wrote:
>> I'm wondering if anyone is able to print rendered HTML via command line.
>> If I print an HTML file using lp it just prints the code. Is there a
>> filter that I am missing?
> CUPS has no built-in filter that would convert your rendered HTML into PostScript. CUPS sees your HTML source code as ASCII text and prints it like that.
> I'd recommend you to install HTMLDOC (written by the same cool developer who created CUPS). Either your distro has packages or you'll have to grab the source from http://www.easysw.com/htmldoc/ and compile it yourself.
> HTMLDOC can convert your HTML into PDF or PostScript. Once you have HTMLDOC, it is relatively easy to write a wrapper script that conforms to the CUPS conventions to act as a CUPS filter.
> (There is also a tool called "html2ps" out there, which may be sufficient for your purpose; it may be possible to do a simple
>    html2ps some.html | lp -d your_printer -
> and get an acceptable result.)
> _______________________________________________
> cups mailing list
> cups at easysw.com
> http://lists.easysw.com/mailman/listinfo/cups

More information about the cups mailing list