itVincent Blog - Java Working Fun!

技术引领时代!
posts - 117, comments - 181, trackbacks - 0, articles - 12

用java将html转化生成png,gif,jpg等图片

Posted on 2011-07-30 11:58 itVincent 阅读(4294) 评论(0)  编辑  收藏 所属分类: Ajax

http://code.google.com/p/java-html2image/

 例子:
HtmlImageGenerator imageGenerator = new HtmlImageGenerator();
imageGenerator
.loadHtml("<b>Hello World!</b> Please goto <a title=\"Goto Google\" href=\"http://www.google.com\">Google</a>.");
imageGenerator
.saveAsImage("hello-world.png");
imageGenerator
.saveAsHtmlWithMap("hello-world.html", "hello-world.png"

只有注册用户登录后才能发表评论。


网站导航: