WordGO - Making it easier for Java to generate word documents
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~~
- 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
<dependency>
<groupId>com.github.qrpcode</groupId>
<artifactId>wordgo</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
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:
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)
👉 WordGO Construct and generate files
👉 Set document attribute information
👉 Text, page change related operations
👉 Create, fill, and add tables related operations
👉 Header and footer related operations
Yes, I also think the code written by me is a bit (very) messy
Come and help me, just pull request after Fork~
(In other words, it can be commercialized, please see the agreement in detail~~)
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!