- 授权协议: Apache-2.0
- 开发语言: Java
- 操作系统: 跨平台
- 软件首页: https://github.com/Sayi/poi-tl
- 软件文档: http://deepoove.com/poi-tl/
软件介绍
Java word的模板引擎,对docx格式的文档增加模板语法,简化样式处理,支持对段落、页眉、页脚、表格等模板替换。
poi-tl是基于apache poi的一套拥有简洁API的跨平台的模板引擎。核心API只需要一行代码:
XWPFTemplate template = XWPFTemplate.compile("~/file.docx").render(datas);
所有的语法结构都是以 {{ 开始,以 }} 结束。
-
{{template}} 普通文本
-
{{@template}} 图片
-
{{#template}} 表格
-
{{*template}} 列表
-
{{+template}} 文档
示例
-
word中包含模板内容{{title}}
-
使用 'XWPFTemplate.compile(file).render(datas)'
-
输出到流OutputStream
//一行代码
XWPFTemplate template = XWPFTemplate.compile("~/template.docx").render(new HashMap(){{
put("title", "Pil-tl 模板引擎");
}});
FileOutputStream out = new FileOutputStream("out_template.docx");
template.write(out);
out.flush();
out.close();
template.close();
传统企业,互联网在踢门
刘润 / 中国华侨出版社 / 2014-7 / 42
1、第一本传统企业互联网化的战略指导书,首次提出“互联网加减法”,迄今最清晰的转型公式 鉴于目前很多传统企业“老办法不管用,新办法不会用”的现状,本书将用“互联网的加减法” 这个简单模型清晰地说明商业新时代的游戏规则和全新玩法,帮助传统企业化解“本领恐慌” 。 2、小米董事长&CEO 金山软件董事长雷军,新东方教育科技集团董事长兼CEO俞敏洪,复旦大学管理学院院长陆雄文,复旦大学博士、......一起来看看 《传统企业,互联网在踢门》 这本书的介绍吧!
