ÓÃJava¶ÁÈ¡pdfÖеÄÊý¾Ý
ÓÃJava¼òµ¥µÄ¶ÁÈ¡pdfÎļþÖеÄÊý¾Ý£ºµÚÒ»²½£ºÏÂÔØPDFBox-0.7.2.jar¡£Ìṩһ¸öÏÂÔØµØÖ·£ºhttp://pdfhome.hope.com.cn/Resource.aspx?CID=63844604-5253-4ae1- b023-258c9e324061&RID=20cd8f94-1cee-40b6-a3df-0ef024f8e0d2½âѹºó£¬°ÑlibÎļþϵÄPDFBox-0.7.2.jar£¬PDFBox-0.7.2-log4j.jar·Åµ½Äãclasspath·¾¶Ï¡££¨ÎÒ°ÑÔ´ÂëÒÔ¼°jar°ü¶¼·Åµ½ÏÂÃæµÄ¸½¼þÀ·½ÃæÄãµÄʹÓᣣ©µÚ¶þ²½£ºÐ´¸ö¼òµ¥µÄ¶ÁÈ¡pdfÎļþµÄ³ÌÐò¡£(PdfReader.java)import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.net.MalformedURLException;
import java.net.URL;
import org.pdfbox.pdmodel.PDDocument;
import org.pdfbox.util.PDFTextStripper;public class PdfReader {public void readFdf(String file) throws Exception {
// ÊÇ·ñÅÅÐò
boolean sort = false;
// pdfÎļþÃû
String pdfFile = file;
// ÊäÈëÎı¾ÎļþÃû³Æ
String textFile = null;
// ±àÂ뷽ʽ
String encoding = "UTF-8";
// ¿ªÊ¼ÌáȡҳÊý
int startPage = 1;
// ½áÊøÌáȡҳÊý
int endPage = Integer.MAX_VALUE;
// ÎļþÊäÈëÁ÷£¬Éú³ÉÎı¾Îļþ
Writer output = null;
// ÄÚ´æÖд洢µÄPDF Document
PDDocument document = null;
try {
try {
// Ê×Ïȵ±×÷Ò»¸öURLÀ´×°ÔØÎļþ£¬Èç¹ûµÃµ½Òì³£ÔÙ´Ó±¾µØÎļþϵͳ//È¥×°ÔØÎļþ
URL url = new URL(pdfFile); //×¢Òâ²ÎÊýÒѲ»ÊÇÒÔǰ°æ±¾ÖеÄURL.¶øÊÇFile¡£
document = PDDocument.load(pdfFile);
// »ñÈ¡PDFµÄÎļþÃû
String fileName = url.getFile();
// ÒÔÔÀ´PDFµÄÃû³ÆÀ´ÃüÃûвúÉúµÄtxtÎļþ
if (fileName.length() > 4) {
File outputFile = new File(fileName.substring(0, fileName
.length() - 4)
+ ".txt");
textFile = outputFile.getName();
}
} catch (MalformedURLException e) {
// Èç¹û×÷ΪURL×°ÔØµÃµ½Òì³£Ôò´ÓÎļþÏµÍ³×°ÔØ //×¢Òâ²ÎÊýÒѲ»ÊÇÒÔǰ°æ±¾ÖеÄURL.¶øÊÇFile¡£
document = PDDocument.load(pdfFile);
if (pdfFile.length() > 4) { textFile = pdfFile.substring(0, pdfFile.length() - 4)
+ ".txt";
}
}
// ÎļþÊäÈëÁ÷£¬Ð´ÈëÎļþµ¹textFile
output = new OutputStreamWriter(new FileOutputStream(textFile),
encoding);
// PDFTextStripperÀ´ÌáÈ¡Îı¾
PDFT
Ïà¹ØÎĵµ£º
ÏÖÔÚÊг¡ÉϵÄoa»ù±¾ÉϿɹé½áΪÁ½´óÕóÓª£¬¼´phpÕóÓªºÍjavaÕóÓª¡£µ«¶Ô½Ó´¥oa²»¾ÃµÄÓû§À´Ëµ£¬¿´µ½µÄÍùÍùÖ»ÊÇËüÃǵıíÏֻ࣬ÊÇÃ÷ÏԵļ۸ñ²îÒ죬ȴºÜÄÑ¿´³öËüÃÇÖ®¼äµÄʵ¼Ê²îÒì¡£Æäʵ£¬ PHP + MYSQL ²»ÖµÇ®²»½ö½ö¾ÖÏÞÓÚoaÈí¼þ£¬¶øÊÇÕûÌåÉÏPHP + MYSQL¿ª·¢µÄÈí¼þ¶¼²»Èçjava¿ª·¢µÄÈí¼þֵǮ¡£ÎªÊ²Ã´PHP + MYSQL µÄOAΪʲô²»ÖµÇ®Ä ......
ת¡¡£º¡¡http://wintys.blog.51cto.com/425414/94051
/**
*Ãû³Æ:BinarySearch
*¹¦ÄÜ:ʵÏÖÁËÕÛ°ë²éÕÒ(¶þ·Ö²éÕÒ)µÄµÝ¹éºÍ·ÇµÝ¹éËã·¨.
*˵Ã÷:
* 1¡¢ÒªÇóËù²éÕÒµÄÊý×éÒÑÓÐÐò,²¢ÇÒÆäÖÐÔªËØÒÑʵÏÖComparable<T>½Ó¿Ú,ÈçInteger¡¢StringµÈ.
* 2¡¢·ÇµÝ¹é²éÕÒʹÓÃsearch( ......
package com.mywebtest.common;
import java.lang.reflect.Array;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
/**
* Java reflection ·Ç³£ÓÐÓã¬ËüʹÀàºÍÊý¾Ý½á¹¹Äܰ´Ãû³Æ¶¯Ì¬¼ìË÷Ïà¹ØÐÅÏ¢£¬²¢ÔÊÐíÔÚÔËÐÐ× ......
µ±JVM£¨JavaÐéÄâ»ú£©Æô¶¯Ê±£¬»áÐγÉÓÉÈý¸öÀà¼ÓÔØÆ÷×é³ÉµÄ³õʼÀà¼ÓÔØÆ÷²ã´Î½á¹¹£º
bootstrap classloader
|
extension classloader
&n ......
Map m = new HashMap();
for (Object o : map.keySet()){
map.get(o);
}
JDK1.4
Map map = new HashMap() ;
Iterator it = map.entrySet().iterator() ;
while (it.hasNext())
{
Map.Entry entry = (Map ......