java²Ù×÷pdf
È»jacobÖÐÒ²ÓйØÓÚPDFµÄ·½·¨£¬µ«ÊǹýÓÚ¸´ÔÓ¡£iTextÊÇÒ»¸ö¿ªÔ´µÄPDF¹¤¾ß£¬Ð¡ÇɶøÓÖ±ã½Ý¡£
¹Ù·½ÍøÕ¾ÊÇ£ºhttp://www.lowagie.com/iText/
¹Ù·½µÄ½âÊÍ£ºiText is a library that allows you to generate PDF files . the fly
×îа汾Ϊ£º2.1.5
ÏÂÔصØÖ·ÊÇ£ºhttp://nchc.dl.sourceforge.net/sourceforge/itext/iText-2.1.5.jar
ÎҵĿª·¢»·¾³:JDK1.6+MyEclipse7+Tomcat5.5.27
Ê×ÏÈÔÚMyEclipseÖÐн¨Ò»¸öÏîÄ¿£¬Ãû³ÆΪiText¡£
н¨Ò»¸öClass£¨ÀࣩHelloWorld.java £¬Package£¨°ü£©Îªcom.test £¬´úÂëÈçÏ£º
package com.test;
import java.io.FileOutputStream;
import java.io.IOException;
import com.lowagie.text.Document;
import com.lowagie.text.DocumentException;
import com.lowagie.text.Paragraph;
import com.lowagie.text.pdf.PdfWriter;
public class HelloWorld {
/**
* Éú³ÉÒ»¸ö¼òµ¥µÄPDFÎļþ£ºHelloWorld.pdf
*
* ×÷ÕߣºÐ¡¶Î
*/
public static void main(String[] args) {
System.out.println("Hello World");
//µÚÒ»²½£º´´½¨Ò»¸ödocument¶ÔÏó¡£
Document document = new Document();
try {
// µÚ¶þ²½£º
// ´´½¨Ò»¸öPdfWriterʵÀý£¬
// ½«ÎļþÊä³öÁ÷Ö¸ÏòÒ»¸öÎļþ¡£
PdfWriter.getInstance(document,new FileOutputStream("C:\\HelloWorld.pdf"));
// µÚÈý²½£º´ò¿ªÎĵµ¡£
document.open();
// µÚËIJ½£ºÔÚÎĵµÖÐÔö¼ÓÒ»¸ö¶ÎÂä¡£
document.add(new Paragraph("Hello World"+","+"Hello iText"+","+"Hello xDuan"));
} catch (DocumentException de) {
System.err.println(de.getMessage());
} catch (IOException ioe) {
System.err.println(ioe.getMessage());
}
// µÚÎå²½£º¹Ø±ÕÎĵµ¡£
Ïà¹ØÎĵµ£º
jdk°²È«Ç¿¶ÈÉèÖãº
http://java.sun.com/javase/downloads/index.jspÖеÄOther DownloadsÏÂÔØ
½âѹzip,
ÓÃÆäÖеÄÁ½¸öjar°ü¸²¸Çjdk6ÏÂ\%JDK_HOME%\jre\lib\securityĿ¼ÏµÄjar°ü
jreĿ¼ÏÂÒ²×÷ÏàͬÅäÖÃ
È»ºóͨ¹ý´úÂë¶Î
try {
& ......
Ò»¡¢Ïß³Ì
1 Ï̵߳Ĵ´½¨
´´½¨Ïß³Ìͨ³£ÓÐÁ½ÖÖ·½·¨: 1) À©Õ¹ThreadÀàʵÏÖÏ̵߳Ĵ´½¨ÊÇ×î³£ÓÃÒ²ÊÇ×îÖ±½ÓµÄÒ»ÖÖ·½·¨£¬Í¨¹ý¼Ì³ÐÀàThreadʵÏÖÏß³ÌÌ壻2) ͨ¹ýʵÏÖRunnable½Ó¿ÚʵÏÖÏß³ÌÌå¡£
2 ThreadÀàµÄ¼¸ÖÖ¹¹Ô캯Êý
1) Thread()
2) Thread(Runnable target)
3) T ......
½áºÏ±¾ÈËѧϰ¾ÑéºÍÍøÉÏÅàѵ»ú¹¹µÄ×ÊÁÏ£¬ÁгöjavaѧϰµÄ˳Ðò¡£
Ò»£ºJ2SE
¡ðÃæÏò¶ÔÏó£·â×°¡¢¼Ì³Ð¡¢¶à̬
¡ðÄÚ´æµÄ·ÖÎö
¡ðµÝ¹é
¡ð¼¯ºÏÀà¡¢·ºÐÍ¡¢×Ô¶¯´ò°üÓë½â°ü¡¢Annotation
¡ðIO
¡ð¶àÏ̡߳¢Ïß³Ìͬ²½
¡ðTCP/UDP
¡ðAWT¡¢Ê¼þÄ£ÐÍ¡¢ÄäÃûÀà
¡ðÕýÔò±í´ïʽ
¡ð·´Éä»úÖÆ
2£ºÊý¾Ý¿â£¨Oracle»òÕßMySQL£©
¡ðSQLÓï¾ä
......
/**
* »ñÈ¡·þÎñÆ÷µÄwebµØÖ·
* @return
*/
private String getWebPath(){
String _tempStr = Thread.currentThread().getContextClassLoader().getResource("").toString();
_tempStr=_tempStr.substring ......
×î½ü¿´µ½µÄһƪÎÄÕ£¬¾õµÃдµÄͦºÃ£¬¾Íת¹ýÀ´ÒÔ±ã×Ô¼ºÀ´¿´¡£
¿´µ½ÂÛ̳ÀïÓиöÌû×ÓÔÚÌÖÂ۽ӿںͳéÏóÀàµÄÇø±ðºÍ×÷Óã¬ÕâÆäʵҲÊǺܶàÃæÊÔ¹Ùϲ»¶ÎʵÄÎÊÌ⣬ÕâÀïÎÒ¾Í˵˵ÎÒµÄ×ܽᣬ˳±ã˵˵ÄÚ²¿ÀàµÄ×÷Ó㬵±ÊǸø¸ÕÈëÃÅ£¬»òÕßÏëѧϰjavaµÄͬѧÃÇÄܸüºÃµÄÀí½âËüÃǵÄÓ÷¨¡£
1.½Ó¿Ú(interface)£¬½Ó¿Ú±»ÓÃÀ´½¨Á¢ÀàÓëÀàÖ®¼ä¹ØÁªµÄ±ê× ......