Java³éÈ¡Word£¬PDFµÄËÄÖÖÎäÆ÷
ÔÚÕâÀï×ܽáһϳéÈ¡word,pdfµÄ¼¸ÖÖ·½·¨¡£
ºÜ¶àÈËÓÃjava½øÐÐÎĵµ²Ù×÷ʱ¾³£»áÓöµ½Ò»¸öÎÊÌ⣬¾ÍÊÇÈçºÎ»ñµÃword£¬excel£¬pdfµÈÎĵµµÄÄÚÈÝ£¿ÎÒÑо¿ÁËһϣ¬ÔÚÕâÀï×ܽáһϳéÈ¡word,pdfµÄ¼¸ÖÖ·½·¨¡£
1. ÓÃjacob
ÆäʵjacobÊÇÒ»¸öbridage£¬Á¬½ÓjavaºÍcom»òÕßwin32º¯ÊýµÄÒ»¸öÖмä¼þ£¬jacob²¢²»ÄÜÖ±½Ó³éÈ¡word,excelµÈÎļþ£¬ÐèÒª×Ô¼ºÐ´dllŶ£¬²»¹ýÒѾÓÐΪÄãдºÃµÄÁË£¬¾ÍÊÇjacobµÄ×÷ÕßÒ»²¢ÌṩÁË¡£
jacob jarÓëdllÎļþÏÂÔØ£º http://danadler.com/jacob/
ÏÂÔØÁËjacob²¢·Åµ½Ö¸¶¨µÄ·¾¶Ö®ºó(dll·Åµ½path,jarÎļþ·Åµ½classpath)£¬¾Í¿ÉÒÔдÄã×Ô¼ºµÄ³éÈ¡³ÌÐòÁË£¬ÏÂÃæÊÇÒ»¸ö¼òµ¥µÄÀý×Ó£º
import java.io.File;
import com.jacob.com.*;
import com.jacob.activeX.*;
/**
* Title: pdf extraction
* Description: email:chris@matrix.org.cn
* Copyright: Matrix Copyright (c) 2003
* Company: Matrix.org.cn
* @author chris
* @version 1.0,who use this example pls remain the declare
*/
public class FileExtracter{
public static void main(String[] args) {
ActiveXComponent component = new ActiveXComponent("Word.Application");
String inFile = "c:\\test.doc";
String tpFile = "c:\\temp.htm";
String otFile = "c:\\temp.xml";
boolean flag = false;
try {
component.setProperty("Visible", new Variant(false));
Object wordacc = component.getProperty("document£®").toDispatch();
Object wordfile = Dispatch.invoke(wordacc,"Open", Dispatch.Method,
new Object[]{inFile,new Variant(false), new Variant(true)},
new int[1] )
Ïà¹ØÎĵµ£º
1 SimpleDateFormatµ£µ±ÖØÈÎ,ÔõÑù¸ñʽ»¯¶¼ÐÐ
import java.util.Date;
import java.text.SimpleDateFormat;
public class Demo
{
public static void main(String[] args)
{
Date now=new Date();
SimpleDateFormat f=newSimpleDateFormat("½ñÌìÊÇ"+"yyyyÄêMMÔÂddÈÕ E kkµãmm·Ö");
System.out.println(f.fo ......
package cn.vicky.reg;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class MyEclipseReg {
// ///////////////////////////////////////////////////////////
// ÔËÐиÃÎļþ ÊäÈëÓû§Ãû µã»÷»Ø³µ¼´¿ÉÉú³É MyEclipse 6.0 ºÍ 7.0 ͨÓû§×¢²áÂë
// ///// ......
Java2ºËÐļ¼ÊõµÚÆß°æÖÐÎÄ°æµÚ¶þ¾í
µÚ600Ò³£¬¾¯¸æ´¦ÕâÑù˵£º
Èç¹û½«jar·ÅÈëjre/lib/extĿ¼ÖУ¬²¢ÇÒÔÚËüµÄÀàÖÐÓÐÒ»¸öÀàÐèÒªµ÷ÓÃϵͳÀà»òÕßÀ©Õ¹À࣬ÄÇô¾Í»áÓöµ½Âé·³¡£À©Õ¹Àà¼ÓÔØÆ÷²¢²»Ê¹ÓÃÀà·¾¶¡£
¸Õ¶Áµ½ÕâÀïÊ®·Ö²»½â£¬ÎªÊ²Ã´Óõ½ÏµÍ³Àà»òÀ©Õ¹Àà»á·¢Éú´íÎ󣿲¢ÇÒÒ»¸öÀàÔõô¿ÉÄܲ»»áÓõ½ÏµÍ³ÀࣿÓÚÊÇ£¬ÕÒµ½Ó¢ÎÄ°æÔÎÄÈ ......
package com.tiantian;
import java.util.*;
public class JAVAContainer {
public static void main(String[] args) throws Exception {
// ArrayList
{
&nb ......
Ç°Ò»¶Îʱ¼ä¸Õ×öÁ˸öjava³ÌÐòºÍÍøÂçÉ϶ą̀»úÆ÷µÄc³ÌÐòͨѶµÄÏîÄ¿£¬×ñѵÄÊÇTCP/IPÐÒ飬Óõ½ÁËjavaµÄSocket±à³Ì¡£ÍøÂçͨѶÊÇjavaµÄÇ¿ÏÓÃTCP/IPÐÒé¿ÉÒÔ·½±ãµÄºÍÍøÂçÉϵÄÆäËû³ÌÐò»¥Í¨ÏûÏ¢¡£
ÏÈÀ´½éÉÜÏÂÍøÂçÐÒ飺
TCP/IP
Transmission Control Proto ......