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 */
public class PdfExtractor { public PdfExtractor() { } public static void main(String args[]) throws Exception { FileInputStream in = new FileInputStream ("c://a.doc"); WordExtractor extractor = new WordExtractor(); String str = extractor.extractText(in); System.out.println("the result length is"+str.length()); System.out.println("the result is"+str); } } 3、pdfbox-用来抽取pdf文件