html2p_w_picpathhttps://code.google.com/p/java-html2p_w_picpath

HtmlImageGenerator Methods

  • loadUrl(url) - Loads HTML from URL object or URL string. (从url载入html)

  • loadHtml(html) - Loads HTML source. (载入本地html)

  • saveAsImage(file) - Save loaded HTML as p_w_picpath. (以图片形式保存html)

  • saveAsHtmlWithMap(file, p_w_picpathUrl) - Creates an HTML file containing client-side p_w_picpath-map <map>generated from HTML's links. (创建一个HTML文件包含客户端p_w_picpath-map)

  • getLinks() - List all links in the HTML document and their corresponding href, target, title, position and dimension. (列出所有在HTML文档的链接和相应href、目标、头衔、位置和尺寸)

  • getBufferedImage() - Get AWT buffered p_w_picpath of the HTML. (获得awt,html缓冲后的图片)

  • getLinksMapMarkup(mapName) - Get HTML snippet of the client-side p_w_picpath-map <map> generated from the links. (HTML代码段里获得的客户端p_w_picpath-map <地图>产生的链接)

  • get/setOrientation(orientation) - Get/Set document orientation (left-to-right or right-to-left). (get/set文本定位)

  • get/setSize(dimension) - Get/Set size of the generated p_w_picpath. (设置生成图片大小)

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


html2pdf

https://code.google.com/p/flying-saucer/

http://www.iteye.com/topic/509417