开发者

Render HTML as Firefox would, without running Firefox

What command-line utility renders HTML as Firefox would, creating a static image, without actually running Firefox and xwd (or ScreenGrab, etc)?

Since all of Firefox's rendering libraries are open source, I'm assuming someone's written something like this? It would be very useful.

I realize static im开发者_如何学运维ages can't have Flash animation (animated GIF/PNG notwithstanding), JavaScript, etc, so I'm just looking for something that renders plain HTML.


html2ps is worth a try, although it does not seem to use the css style sheets. This is a serious limitation.

On Debian/Ubuntu, it is provided as a package, so the classical sudo apt-get install html2ps will be fine.

(I know this has been given in the comments, but for the future reader, I thought it might be easier to find as an answer.)


You could write a small script which simply runs firefox using the command line options does a screen-shot, then closes firefox. Should only be about 3 lines of code to get started.

firefox -url http://mysite.com/homepage.php

https://developer.mozilla.org/en/Command_Line_Options

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜