java°Ñwordתhtml»òtxt
×î½üÏîÄ¿ÖÐÐèÒªÔÚÒ³ÃæÖÐÔ¤ÀÀwordÎļþ£¬Ëä˵word±¾Éí¾Í¿ÉÒÔÔÚÒ³ÃæÖдò¿ª£¬µ«ÊÇÓÐÁ½¸ö±×¶Ë£¬1ÊÇ¿É¿Í»§¶Ë±ØÐë°²×°word£¬ 2ÊÇ¿Í»§¶ËµÄ»·¾³ÒÔ¼°office°æ±¾ÓвîÒ죬»áÔì³ÉÔ¤ÀÀ²»Îȶ¨¡£ÔÚÍøÉÏÕÒÁËһϣ¬·¢ÏÖpoi¿ÉÒÔ°Ñword×°»»³Étxt,µ«ÊǸñʽ¶¼¶ªÁË,Ö»ÓйâͺͺµÄÎı¾,ÓÖËÑjacob, ÍøÓÑÃÇÖÚ˵·×ç¡, ×îºó»¹ÊÇ×Ô¼ºsourceforgeÉÏÏÂÔØjacob²¢ÔĶÁdoc¸ã¶¨ÁË.
1 goto http://sourceforge.net/projects/jacob-project/ and download latest library of jacob.
ÏÂÔصÄzipÎļþ½á¹¹ÈçÏÂ:
2 intel cpuµÄ»úÆ÷¿½±´jacob-1.15-M3-x86.dllµ½%JAVA_HOME%/jre/bin, AMD cpuµÄ»úÆ÷¿½±´jacob-1.15-M3-x64.dll. ²»¹ýÇëÈ·±£jreĿ¼ÊÇÄãÕýÔÚʹÓõÄjre, ÒòΪÏÖÔںܶàeclipse°æ±¾×Ô¼º´øjre. Õâ¸öÔÚeclipse windows-> preferences -> installed jres¿ÉÒԲ鿴.
3 ¿½±´jacob.jarµ½ÄãÏîĿĿ¼µÄlibÏÂÃ沢ȷ±£¼ÓÈëµ½ÁËclasspath.
×¼±¸¹¤×÷Íê±Ï, ÏÖÔÚ¾Íд³ÌÐòÁË.
import com.jacob.activeX.ActiveXComponent;
import com.jacob.com.Dispatch;
import com.jacob.com.Variant;
public class Test {
public static void main(String[] args) {
ActiveXComponent app = new ActiveXComponent("Word.Application");
app.setProperty("Visible", new Variant(false));
Dispatch doc1 = app.getProperty("Documents").toDispatch();
//´ò¿ªaaaa.doc
Dispatch doc2 = Dispatch.invoke(
doc1,
"Open",
Dispatch.Method,
new Object[]{"e:\\aaaa.doc", new Variant(false), new Variant(true)},
new int[1]
).toDispatch();
//Áí´æΪaaaa.html
Dispatch.invoke(
doc2,
"SaveAs",
Dispatch.Method,
new Object[]{
"c:\\aaaa.html",
new Variant(8)//7Ϊtxt¸ñʽ£¬ 8±£´æΪhtml¸ñʽ
},
new int[1]
);
Variant f = new Variant(false);
Dispatch.call(doc2, "Close", f);
}
}
ʹÓÃÆðÀ´ºÜ¼òµ¥.
µ±È»jacob²»¹â¿ÉÒÔ×öword to html, »¹¿ÉÒÔ×öºÜ¶àÊÂÇé:
Jacob is a Java library that lets Java applications communicate with Microsoft Windows DLLs or COM libraries. It does this through the use of a custom DLL that the Jacob Java classes communicate with via JNI. The library and dll isolate the Java developer from the underlying windows libraries so that
Ïà¹ØÎĵµ£º
±¾ÎÄת×Ô£ºhttp://hi.baidu.com/%E6%AD%A3%E9%81%93%E6%B0%94%E5%8A%9F/blog/item/70a90e01e69516e708fa93c6.html
ÓÉÓÚ±¾ÈËÔÚ×ö MOTO ÊÖ»úÉϵÄÒ»¿îÔĶÁÆ÷
Anyview ʱ£¬²¢²»ÂúÒâÊÖ»ú×Ô´øµÄ×ֿ⣬Òò´Ë£¬Ê¹ÓÃÁËÍâ¹Ò×ֿ⣬ÔÚ±àÂë¹ý³ÌÖУ¬×ܽáÁËһЩ¾Ñ飬ÌؼǼÏÂÀ´Óë´ó¼Ò·ÖÏí¡£ËäÈ»ÔĶÁÆ÷ÊÇʹÓà J2ME
¿ª·¢£¬µ«Æä»ù±¾ÔÀíÊ ......
Ç뿼ÂÇÏÂÃæÕâ¶Î»°ËùÃèÊöµÄÎÊÌ⣺
TomÔÚÒ»¼ÒÆû³µÅä¼þÉ̵깺ÂòÁËÒ»¸ö¼ÛÖµ$1.10µÄ»ð»¨Èû£¬µ«ÊÇËûÇ®°üÖж¼ÊÇÁ½ÃÀÔªÒ»Õŵij®Æ±¡£Èç¹ûËûÓÃÒ»ÕÅÁ½ÃÀÔªµÄ³®Æ±Ö§¸¶Õâ¸ö»ð»¨Èû£¬ÄÇôӦ¸ÃÕÒ¸øËû¶àÉÙÁãÇ®ÄØ£¿
ÏÂÃæÊÇÒ»¸öÊÔͼ½â¾öÉÏÊöÎÊÌâµÄ³ÌÐò£¬Ëü»á´òÓ¡³öʲôÄØ£¿
public class Change{
public static void main(String args[ ......
Java ClassLoader (1) – What is a ClassLoader?
Java ClassLoader (2) – Write your own ClassLoader
Java ClassLoader (3) – Namespaces
Java ClassLoader (4) – Loading a custom ClassLoader on JVM start ......
Spring Framework ¡¾Java¿ªÔ´ J2EE¿ò¼Ü¡¿
SpringÊÇÒ»¸ö½â¾öÁËÐí¶àÔÚJ2EE¿ª·¢Öг£¼ûµÄÎÊÌâµÄÇ¿´ó¿ò¼Ü¡£ SpringÌṩÁ˹ÜÀíÒµÎñ¶ÔÏóµÄÒ»Ö·½·¨²¢ÇÒ¹ÄÀøÁË×¢Èë¶Ô½Ó¿Ú±à³Ì¶ø²»ÊǶÔÀà±à³ÌµÄÁ¼ºÃÏ°¹ß¡£SpringµÄ¼Ü¹¹»ù´¡ÊÇ»ùÓÚʹÓÃJavaBeanÊôÐ﵀ Inversion of ControlÈÝÆ÷¡£È»¶ø£¬Õâ½ö½öÊÇÍêÕûͼ¾°ÖеÄÒ»²¿·Ö£ºSpringÔÚʹ ......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=gb2312" http-equiv="Content-Type" />
<title>¼òµ¥µÄ²âÊÔÒ³Ãæ</title> ......