poi-tl-ext
Introduction: Extensions for poi-tl
Tags:
Maven
poi 4.x poi-tl 1.11 以前的版本
<dependency>
<groupId>io.github.draco1023</groupId>
<artifactId>poi-tl-ext</artifactId>
<version>0.4.24</version>
</dependency>
poi 5.x poi-tl 1.11.0+
<dependency>
<groupId>io.github.draco1023</groupId>
<artifactId>poi-tl-ext</artifactId>
<version>0.4.24-poi5</version>
</dependency>
扩展功能
在 poi-tl 的基础上扩展了如下功能:
支持渲染
HTML字符串,插件HtmlRenderPolicy的使用方法如下(也可参考文档)HtmlRenderPolicy htmlRenderPolicy = new HtmlRenderPolicy(); Configure configure = Configure.builder() .bind("key", htmlRenderPolicy) .build(); Map<String, Object> data = new HashMap<>(); data.put("key", "<p>Hello <b>world</b>!</p>"); XWPFTemplate.compile("input.docx", configure).render(data).writeToFile("output.docx");HtmlRenderPolicy可以通过HtmlRenderConfig进行如下设置:globalFont全局默认字体(用于归一化处理,而不是用于样式兜底)globalFontSize全局默认字号(用于归一化处理,而不是用于样式兜底)showDefaultTableBorderInTableCell是否显示嵌套表格的边框(poi生成嵌套表格时默认不显示边框,见#12)numberingIndent多级列表项缩进长度,默认值 360numberingHanging列表项悬挂长度,默认值 360,CSS 样式list-style-position为inside时该参数无效numberingSpacing列表编号与内容之间的间隔类型,STLevelSuffix.NOTHING/STLevelSuffix.SPACE/STLevelSuffix.TAB
自定义
<latex>标签,允许渲染嵌入在HTML中的LaTeX,字符串格式可参考文档。目前实现了富文本编辑器可实现的大部分效果,后续继续改进...
支持渲染
MathML字符串,插件类为MathMLRenderPolicy- 支持渲染
LaTeX字符串,插件类为LaTeXRenderPolicy
支持我
如果您觉得这个插件节省了您的时间和精力,或者解决了您的难题,可以考虑支持一下我的工作,感谢! ⚡⚡⚡

