Java¶ÁÈ¡PDF,DocµÄ·½·¨
ºÜ¶àÈËÎʵ½ÈçºÎ³éÈ¡word£¬excel£¬pdf°¢¡£ÕâÀïÎÒ×ܽáһϳéÈ¡word,pdfµÄ
¼¸ÖÖ·½·¨¡£
1¡£ÓÃjacob.
ÆäʵjacobÊÇÒ»¸öbridage£¬Á¬½ÓjavaºÍcom»òÕßwin32º¯ÊýµÄÒ»¸öÖмä¼þ£¬jacob²¢²»ÄÜÖ±½Ó³éÈ¡word,excelµÈÎļþ£¬ÐèÒª×Ô¼ºÐ´dllŶ£¬²»¹ýÒѾÓÐΪÄãдºÃµÄÁË£¬¾ÍÊÇjacobµÄ×÷ÕßÒ»²¢ÌṩÁË¡£
jacobÏÂÔØ£ºhttp://www.matrix.org.cn/down_view.asp?id=13
ÏÂÔØÁËjacob²¢·Åµ½Ö¸¶¨µÄ·¾¶Ö®ºó(dll·Åµ½path,jarÎļþ·Åµ½classpath)£¬¾Í¿ÉÒÔдÄã×Ô¼ºµÄ³éÈ¡³ÌÐòÁË£¬ÏÂÃæÊÇÒ»¸öÀý×Ó£º
import java.io.File;
import com.jacob.com.*;
import com.jacob.activeX.*;
public class FileExtracter{
public static void main(String[] args) {
ActiveXComponent app = new ActiveXComponent("Word.Application");
String inFile = "c:\\test.doc";
String tpFile = "c:\\temp.htm";
String otFile = "c:\\temp.xml";
boolean flag = false;
try {
app.setProperty("Visible", new Variant(false));
Object docs = app.getProperty("Documents").toDispatch();
Object doc = Dispatch.invoke(docs,"Open", Dispatch.Method, new Object[]{inFile,new Variant(false), new Variant(true)}, new int[1]).toDispatch();
Dispatch.invoke(doc,"SaveAs", Dispatch.Method, new Object[]{tpFile,new Variant(8)}, new int[1]);
Variant f = new Variant(false);
Dispatch.call(doc, "Close", f);
flag = true;
} catch (Exception e) {
e.printStackTrace();
} finally {
app.invoke("Quit", new Variant[] {});
}
}
}
2¡£ÓÃapacheµÄpoiÀ´³éÈ¡word£¬excel¡£
poiÊÇapacheµÄÒ»¸öÏîÄ¿£¬²»¹ý¾ÍËãÓÃpoiÄã¿ÉÄܶ¼¾õµÃºÜ·³£¬²»¹ý²»Òª½ô£¬ÕâÀïÌṩÁ˸ü¼Ó¼òµ¥µÄÒ»¸ö½Ó¿Ú¸øÄ㣺
ÏÂÔØ¾¹ý·â×°ºóµÄpoi°ü£ºhttp://www.matrix.org.cn/down_view.asp?id=14
ÏÂÔØÖ®ºó£¬·Åµ½ÄãµÄclasspath¾Í¿ÉÒÔÁË£¬ÏÂÃæÊÇÈçºÎʹÓÃËüµÄÒ»¸öÀý×Ó£º
import java.io.*;
import org.textmining.text.extraction.WordExtractor;
/**
* <p>Title: pdf extraction</p>
* <p>Description: email:chris@matrix.org.cn</p>
* <p>Copyright: Matrix Copyright (c) 2003</p>
* <p>Company: Matrix.org.cn</p>
* @author chris
* @version 1.0,who use this example pls remain the declare
*/
Ïà¹ØÎĵµ£º
ÎÒÃÇÔÚjspÒ³ÃæÉϵÄjs½Å±¾ÖпÉÒÔµ÷ÑÐjava´úÂ룬±ÈÈ磬ÎÒÃÇÐèÒªÔÙjsÖÐÓÃalertº¯ÊýÏÔʾ·þÎñÆ÷¶Ë·¢Ë͹ýÀ´µÄij¸ö×Ö·û´®ÄÇôÎÒÃÇ¿ÉÒÔÕâÑù×ö
tomcat주
ÔÚ·þÎñÆ÷¶ËÎÒÃÇÓÐrequest.setAttribute("name","abc");
ÄÇôÎÒÒªÔÚÒ³ÃæÉÏÓÃalertÏÔʾµÄ»°£¬ÓÐÁ½ÖÖ·½Ê½£º
1¡¢Ê¹ÓÃEL±í´ïʽ
ÔÚEl±í´ïʽµÄÍâÃæÓÃÒýºÅ¼´¿É£º
<scri ......
½«ÒÔÏÂÄÚÈݸ´ÖÆEclipseÖÐÔËÐУ¬ËæÒâÊäÈëÒ»¸öÓû§Ãû£¬³ÌÐò»á×Ô¶¯¼ÆËã³ö×¢²áÂ룬¾ø¶ÔÄÜÓã¡£¡£¡
package sun;
import java.io.*;
public class MyEclipseGen {
private static f ......
Problem: email thread is hanging at socket read
Today we found a email problem in production, all of the mail threads (3 threads) are hanging/sitting/blocking at same point
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
......
ÔÚѧУ×ÔѧJava£¬ÓõÄÊÇ¡¶Java³ÌÐòÉè¼Æ——Ò»ÖÖ¿ìѧ¿ÆµÄ·½·¨¡·¡£¿´ÁËÒÔºó·¢ÏÖ£¬°¡£¬ÕæÊÇÒ»±¾ºÃÊé¡£ËüÕæÊÇ¿çѧ¿Æ°¡£¬Êýѧ£¬ÎïÀí£¬ÉúÎïÎÊÌâ¶¼¿ÉÒÔÓÃJava×÷Ϊ¹¤¾ßÀ´Ñо¿¡£³ýÁ˸÷ÖÖÊýѧÎÊÌ⣬±ÈÈçËã·¨£¬µÝ¹é£¬Ëü»¹Ñо¿ÁËÎïÀíÎÊÌâ¡£ËüÉæ¼°Á˸÷ÖÖÎÊÌâ£¬ÉøÍ¸ÀíÂÛ£¬»ùÒò×éѧ£¬Mandelbort¼¯µÈ¡£×îÅ£µÄÊÇ£¬ËüÓÃÆõԼʽµÄÉè¼ ......