内容简介:当程序员需要创建Word文档的时候,使用模板生成word可能是一个更好的选择,poi-tl基于Microsoft Word模板和数据生成新的Word文档,可能是Java中最好的Word模板引擎。 V1.10.0正式版本已经发布,增加了很多新特性:...
当 程序员 需要创建Word文档的时候,使用模板生成word可能是一个更好的选择,poi-tl基于Microsoft Word模板和数据生成新的Word文档,可能是 Java 中最好的Word模板引擎。
V1.10.0正式版本已经发布,增加了很多新特性:
- 全方位支持Word批注功能(注:当前Apache POI原生还不支持批注)
- 图片支持SVG、Base64,支持自动识别各种图片类型
- 新增插件HighlightRenderPolicy:Word中代码块高亮展示,支持26种语言和上百种着色样式
- 新增插件MarkdownRenderPolicy:Markdown转为word文档,包括表格、代码块、锚点、引用、加粗斜体等
- 若干性能和功能优化、BUGFIX
代码高亮示例
HighlightRenderData code = new HighlightRenderData();
code.setCode("/**\n"
+ " * @author John Smith <john.smith@example.com>\n"
+ "*/\n"
+ "package l2f.gameserver.model;\n"
+ "\n"
+ "public abstract strictfp class L2Char extends L2Object {\n"
+ " public static final Short ERROR = 0x0001;\n"
+ "\n"
+ " public void moveTo(int x, int y, int z) {\n"
+ " _ai = null;\n"
+ " log(\"Should not be called\");\n"
+ " if (1 > 5) { // wtf!?\n"
+ " return;\n"
+ " }\n"
+ " }\n"
+ "}");
code.setLanguage("java");
code.setStyle(HighlightStyle.builder().withShowLine(true).withTheme("zenburn").build());
生成示例

以上所述就是小编给大家介绍的《Word 模板引擎 poi-tl V1.10.0 发布,支持批注和代码高亮》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
The Sovereign Individual
James Dale Davidson、William Rees-Mogg / Free Press / 1999-08-26 / USD 16.00
Two renowned investment advisors and authors of the bestseller The Great Reckoning bring to light both currents of disaster and the potential for prosperity and renewal in the face of radical changes ......一起来看看 《The Sovereign Individual》 这本书的介绍吧!
