web-dev-qa-db-ja.com

生のHTMLをレンダリングし、コマンドラインから(プリンターに)印刷するための最良の方法は何ですか?

言い換えれば、これが私のWebページです。

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

そして、私は次のようなコマンドを探しています

/usr/bin/curl --cookie ~/.cookies 'http://somewhere.com' | render_raw_html_to_image | lpr
2
Aaron F.

コマンドライン印刷 拡張子を付けてFirefoxを使用できます。

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

ソース

8
Andrea Ambu

wkhtmltopdf を使用してみてください。これは、Webkitエンジンを使用してHTMLページをPDFファイル。その後、PDFを印刷できます。

3
mfriedman

http://htmldoc.org/ 役立つ場合があります。

0
Xerxes

ダンプスイッチでリンクを使用できます。

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

そして、lynxについても同じです。

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

また、w3mでも同じです。

w3m www.google.com -dump > formatedOutput.txt
0
Kyle Brandt