Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ÇóÖú£ºÇëÎÊÓÐûÓÐʲôjava¿ªÔ´×é¼þÄܽ«ÍøÒ³×ª³ÉͼƬ£¿

¸÷λ¸ßÊÖ£¬ÇëÎÊÓÐûÓÐʲôjava¿ªÔ´×é¼þÄܹ»ÊµÏÖ½«IEä¯ÀÀÆ÷´ò¿ªµÄÍøÒ³×ª»»ÎªÍ¼Æ¬£¿£¿£¿£¿
he Flying Saucer Project
An XML/XHTML/CSS 2.1 Renderer
https://xhtmlrenderer.dev.java.net/

Rendering to an Image

You can render from a document directly to an image format of your choice using org.xhtmlrenderer.simple.ImageRenderer. To use ImageRenderer, just call ImageRenderer.renderToImage(url, path, width), or one of the overloaded versions of the method. You must specify either a width or a width and a height for the image if you like; if height is not specified, it's determined based on the content of the document. renderToImage() creates the document, writes it out to the given path, and returns a java.awt.image.BufferedImage which you can further manipulate—for example, scale and re-save or save in multiple image formats. Here's a simple sample rendering the contents of the http://www.w3c.org homepage:

Java code:
String address = "http://www.w3.org/";

// render
try {
BufferedImage buff = null;
buff = Graphics2DRenderer.renderToImage(address, "w3c-homepage.png", 1024);
} catch (IOException e) {
e.printStackTrace();
}


That's it. You can use Java's ImageIO class to write the image out in different formats; it supports writing most image fo


Ïà¹ØÎÊ´ð£º

java http ÎÊÌâ - Java / Java EE

ÎÊÌâÃèÊö£ºÐ´ÈÕÖ¾¹¦ÄÜ£¬Ð´ºÃµÄдÈÕÖ¾·þÎñ£¬ÆäËûÓû§Í¨¹ýhttpµ÷Ó÷þÎñ£¬´«Èë²ÎÊý£¬È»ºó¼Ç¼ÈÕÖ¾£¬
  ÎҵķþÎñ¸ÃÔõôд£¬ ±ðÈËÔõôͨ¹ýhttpµ÷ÓÃÎҵķþÎñ£¬ÎÒÓÃwebserviceдºÃÁËÒ»¸ö£¬¿ÉÊDz¢·¢ÓÐÉÏÏߣ¬Ïë¸ÄÓ ......

java appletÔÚhtmlÖÐÎÞ·¨ÏÔʾ

ÎÒµÄjava applet ǶÈëhtmlºóÎÞ·¨ÏÔʾ£¬¶øÓÃappletviewerÏÔʾÕý³£ÎªÊ²Ã´£¬»¹ÓоÍÊÇÓÃhtml converterת»¯ºó¿ÉÒÔÏÔʾ£¬ÎªÊ²Ã´£¿Çë´óÏÀ´Í½Ì£¡
HTML code:

<HTML>
<HEAD>
<TITLE>TEST.HTML< ......

Ï£ÍûºÃÐÄÈ˰ï°ïÎÒ£¬ÓйØÊÖ»úqq2009µÄjava°æ

ÎÒÏ£ÍûÔڱ༭ÎÄ×Öºó°Ñ·¢Ëͼü¸Äµ½ÆÁÄ»Öм䣬¾ßÌå˵¾ÍÊÇ
ÔÚkb.classÖеIJ¿·Ö×÷³öÐÞ¸Ä


²¿·Ö´úÂ룺
V = new TextBox(ld.a(383), "", 190, 0);
        X = new Comma ......

eclipse java ¿ØÖÆÌ¨ - Java / Java SE

ÔõôÔÚ¿ØÖÆÌ¨ÖÐÊäÈëÀàËÆÏÂÃæµÄÐÅÏ¢£º
 s1234 50  
  s1235 80  
  s1234 90  
  s1234 40  
  s1236 90  
ÿµ±»Ø³µÊ± ......

C/SÏîÄ¿¼Ü¹¹Éè¼Æ----ÇóÖú - Java / Java SE

±¾ÈËÕýÔÚÓÃJava×öÒ»¸öC/S¼Ü¹¹µÄÏîÄ¿£¬ 
¿ÉÊÇÓÉÓÚÏîÄ¿±È½Ï´ó£¬Ç°ÆÚ¶Ô¼Ü¹¹µÄÉè¼ÆÓÈÆäÖØÒª£¬ÒòΪºóÆÚ¿ÉÄÜËæÊ±»á¼Ó¸ö¹¦ÄÜ»òÕßÈ¥µôijЩ¹¦ÄÜ¡£ 
ËùÒÔÌØµØÑ°ÇóÈçºÎÉè¼ÆC/SµÄ¼Ü¹¹Ê¹³ÌÐò¸ü¼ÓÃæÏò¶ÔÏó¸ü¼ÓÒ×ÓÚά ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ