Print HTML file via shell command

Berna Massingill bmassing at cs.trinity.edu
Thu Nov 3 07:40:19 UTC 2005


On Wed, Nov 02, 2005 at 09:15:18AM +0000, Dave Cross wrote:

>>  On 11/1/05, Berna Massingill <bmassing at cs.trinity.edu> wrote:
>>  > On Tue, Nov 01, 2005 at 09:02:04AM -0800, Leon Pu wrote:
>>  
>>  > >>  I want to print out the HTML file in its web page format, not the HTML
>>  > >>  source.
>>  > >>
>>  > >>  It's better to print out the HTML file in web format via one shell
>>  > >>  command likes [htmllpr foo.html].
>>  > >>
>>  > >>  If there is no possibility to print out HTML via shell command
>>  > >>  directly, is it possbile to convert the HTML file to PDF or PostScript
>>  > >>  by shell then I can print out?
>>  > >>
>>  > >>  Thanks for your reply.
>>  >
>>  > There's a program "html2ps" that I think will do what you want.  It's a
>>  > Perl script, and a Google search for "html2ps" should find it.
>>  
>>  Last time I tried to use that, it was a little clunky. It may have
>>  improved in the last couple of years though.

The most recent version I found with a quick search is very similar
to the two-year-old version I've used.  "Clunky" is apt, but I've
found the program useful for doing with the OP describes, well worth
what I paid for it.  

>>  Given that Firefox has a pretty decent 'print to ps' option, it's
>>  disappointing that you can't access it from the command line. It would
>>  be great to be able to script stuff like
>>  
>>    $ firefox --as_ps http://example.com/ > example.ps
>>  

That would indeed be nice.

-- blm




More information about the users mailing list