从命令行呈现原始 HTML 并打印它(到打印机)的最佳方法是什么?

Aar*_* F. 2 linux command-line-interface printing

换句话说,这是我的网页:

/usr/bin/curl --cookie ~/.cookies 'http://somewhere.com'
Run Code Online (Sandbox Code Playgroud)

我正在寻找一个类似的命令

/usr/bin/curl --cookie ~/.cookies 'http://somewhere.com' | render_raw_html_to_image | lpr
Run Code Online (Sandbox Code Playgroud)

And*_*mbu 8

您可以将 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
Run Code Online (Sandbox Code Playgroud)

来源

  • 这似乎已被弃用:( (3认同)