# word-utils **Repository Path**: pushbug/word-utils ## Basic Information - **Project Name**: word-utils - **Description**: word模板填充 and word转PDF - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 12 - **Forks**: 7 - **Created**: 2024-07-07 - **Last Updated**: 2025-07-03 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README

Word填充和转PDF

填充基于poi-tl

https://deepoove.com/poi-tl 1. Maven ```xml com.deepoove poi-tl 1.12.2 ``` 2. 新建Word文档template.docx,包含标签 {{title}} ```docx template.docx {{title}} ``` 3. 代码示例 ```java XWPFTemplate template = XWPFTemplate.compile("template.docx").render( new HashMap(){{ put("title", "Hi, poi-tl Word模板引擎"); }}); template.writeAndClose(new FileOutputStream("output.docx")); ```

转PDF基于aspose-words

aspose word(这个是收费的/(ㄒoㄒ)/~~) 下面的maven地址是破解版本 1. Maven ```xml com.luhuiguo aspose-words 23.1 ``` 2. 代码示例 ```java Document doc = new Document(wordFilePath); fileOS = new FileOutputStream(new File(pdfFilePath)); doc.save(fileOS, SaveFormat.PDF); ```