开发者

How to convert an html webpage to a picture

开发者 https://www.devze.com 2023-01-27 20:05 出处:网络
How to convert an html webpage to a picturelike google preview. Is there a Java library permitting this?

How to convert an html webpage to a picture like google preview.

Is there a Java library permitting this?

Is there a command-line argument to call browsers to make them convert a web page into a pi开发者_如何学运维cture .png for instance?


Using Qt, you can create a simple window with a QWebView (this is webkit under the covers), and then use QWidget::render() method to get QPixmap, and then convert it to QImage.

Qt is C++, but python and java bindings exist also.


http://www.roseindia.net/java/example/java/swing/Print.shtml

Here's a way to do it!


See here. It shows that iText and FlyingSaucer (xhtmlrenderer) have such options.

0

精彩评论

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

关注公众号