Java Jacob word (1)

Source: Internet
Author: User

JACOB:
Jacob is a bridge between Java and Microsoft's COM components. By using the DLL dynamic link library that comes with Jacob, the Program on Sun Java platform calls com through JNI!
:
Http://sourceforge.net/project/showfiles.php? Group_id = 109543 & package_id = 118368

There are many available versions. Now I am using: jacb_1.11.1
Function: supports word, PDF, and Excel operations and conversion!
JDK version: jdk1.4
Role of my implementation: Use plug-ins: create Word files in the format specified by word

Configuration description ::

Decompress the file: jacob_1.11.1.zip, copy Jacob. jar, and add it to classpath.

Copy Jacob. dll in the Java JDK bin directory

 

Use Jacob to interact with word.
Example of http://www.99inf.net/SoftwareDev/Java/54344.htm
The example is well done, and the annotations are well written.
Configuration instructions:
Http://www.danadler.com/jacob/
Download Jacob's package officially. Jacob-1.14.1
Configuration:
1. Jacob-1.14.1-x86.dll file, loaded into the system environment variable path.
2. Copy the jacob-1.14.1-x86.dll file to Windows/system32.
3. Copy the jacob-1.14.1-x86.dll file to JDK/bin.
Otherwise, the. dll file may not be found. The program cannot run.
In the following example, some strings are written to the specified word. Programs can run in. java files .. JSP and Servlet environments.

Tool. javapackage com. test;

Public class tool ...{
Public tool ()...{

}
Public static string [] splitstring (string STR, string split )...{
Return Str. Split (split );
}
}

Of course, the second file is not required and can be written directly in the previous class. The function of the method is to split the string and generate an array of small strings.
You can run the preceding example in JSP or servlet mode. Open a Word document to directly generate the content. And print it.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.