3

Put another way, here's my web page:

/usr/bin/curl --cookie ~/.cookies 'http://somewhere.com'

And I'm looking for a command that goes something like

/usr/bin/curl --cookie ~/.cookies 'http://somewhere.com' | render_raw_html_to_image | lpr
Aaron F.
  • 33
  • 1
  • 5
  • i.e. I'm trying to print the actual, rendered web page. Not the source code. Any browser rendering will do. – Aaron F. Aug 05 '09 at 08:46

4 Answers4

8

You can use firefox with the Command Line Print extension.

firefox -print http://www.example.com/index.html
firefox -print http://www.example.com/index.html -printmode pdf -printfile ../foo.pdf
firefox -print http://www.example.com/index.html -printmode PNG
firefox -print http://www.example.com/index.html -printdelay 10

source

Andrea Ambu
  • 480
  • 1
  • 7
  • 13
4

You could try using wkhtmltopdf, which uses the webkit engine to render an HTML page into a PDF file. Then you can print the PDF.

mfriedman
  • 1,959
  • 1
  • 13
  • 14
0

http://htmldoc.org/ may help.

Xerxes
  • 4,133
  • 3
  • 26
  • 33
0

You can use links with the dump switch:

links www.google.com -dump > formatedOutput.txt

And the same with lynx:

lynx www.google.com -dump > formatedOutput.txt

And yet again, the same with w3m:

w3m www.google.com -dump > formatedOutput.txt
Kyle Brandt
  • 82,107
  • 71
  • 302
  • 444