Skip to content

Latest commit

 

History

History
95 lines (53 loc) · 3.04 KB

README_EN.md

File metadata and controls

95 lines (53 loc) · 3.04 KB

Word GO

WordGO - Making it easier for Java to generate word documents

Background

In traditional Java Word generation, template files are usually created manually and then imported. If you don't want to create a template and want less code, it's a good idea to choose Word Go~~

Installation

Manually import the jar package

  • IDEA import: Click File-Project Structure; then find Modules on the left and click; finally, click the green + sign on the right, select JARs or directories and select the jar package to be imported.
  • Eclipse import: right-click "Project" → select Properties, select Java Build Path in the list on the left side of the pop-up dialog box

maven import

<dependency>
 <groupId>com.github.qrpcode</groupId>
 <artifactId>wordgo</artifactId>
 <version>1.0-SNAPSHOT</version>
</dependency>

Environment dependency and compatibility

It can be used as long as it can run java, it does not rely on any third-party Office applications

See the table for compatibility:

我的兼容性

Use

Let’s create a "Hello World" first

WordGo wordGo = new WordGo();
//Create a new word
wordGo.add("Hello World", "font-size: 15; color: #FF0000");
//Fill in the data to view the corresponding function description
wordGo.create("C:\\demo.docx");
//Finally, it can be generated. The parameter is the generation directory, which must have a file name and end with. Docx

Yes, it is very similar to Css, it is easy to use~~

Code support JDK1.5 + (inclusive)

Corresponding function description

(can be learned in 10 minutes)

👉 WordGO Construct and generate files

👉 Set document attribute information

👉 Set paper size and margins

👉 Text, page change related operations

👉 Create, fill, and add tables related operations

👉 Picture related operations

👉 Header and footer related operations

Main project leader

@qrpcode

Join

Yes, I also think the code written by me is a bit (very) messy

Come and help me, just pull request after Fork~

Open source agreement

Apache-2.0 License

(In other words, it can be commercialized, please see the agreement in detail~~)

💖 If you find it useful, remember to star ⭐

PS:Welcome to download and try it out. If you need to apply it to commercial projects, please be sure to test all possible functions in advance to avoid generation deviation.

Feel free to leave a message if you find a bug!