当前位置:网站首页>利用Poi-tl在word模板表格单元格内一次插入多张图片和多行单元格相同数据自动合并的功能组件
利用Poi-tl在word模板表格单元格内一次插入多张图片和多行单元格相同数据自动合并的功能组件
2022-07-29 05:09:00 【晶格点阵】
一、插入多张图片的方法
1)文档中提供的使用区块实现多张图片的插入
区块的使用:在word模板中使用:
{ {?images}}
{ {url}}
{ {/images}}
这样定义模板后,数据模型的结构如下:
data.put("items", new ArrayList<JSONObject>(){
{
add(new JSONObject().fluentPut("url", "图片链接1"));
add(new JSONObject().fluentPut("url", "图片链接2"));
add(new JSONObject().fluentPut("url", "图片链接3"));
}});上述图片链接也可以通过 Pictures.ofUrl().create() 构建 PictureRenderData 使用。
2)自定义插件实现多张图片的插入
按照方法插入多张图片时,必须使用对象的列表,也就是说必须在items列表添加包含url属性的对象;我们想让插入多张图变得更方便,使用'&'字符做为自定义插件的前缀。
插入多张图片的插件代码如下:
package com.fight.strive.sys.modules.poi_tl;
import com.deepoove.poi.data.PictureRenderData;
import com.deepoove.poi.policy.AbstractRenderPolicy;
imp边栏推荐
- 三次握手四次挥手针对面试总结
- WDDM learning
- CSDN的md编辑器如何输入上下标?公式和非公式的输入方式不一样
- Why is Google's internal tools not suitable for you?
- Complete ecological map of R & D Efficiency & selection of Devops tools
- Custom QML control: imagebutton
- Live broadcast preview | how to save 30% labor cost and shorten 80% trademark processing cycle?
- 省市区三级联动(简单又完美)
- Differences between texture2d and texture2dproj under webgl1.0
- APP常用跨端技术栈深入分析
猜你喜欢

京东云分布式链路追踪在金融场景的最佳实践

Live broadcast preview | how to save 30% labor cost and shorten 80% trademark processing cycle?

How rimworld uploads creative workshops through steamcmd

阿里云架构师梁旭:MES on 云盒,助力客户快速构建数字工厂

千人规模互联网公司研发效能成功之路

365天挑战LeetCode1000题——Day 036 二叉树剪枝 + 子数组和排序后的区间和 + 删除最短的子数组使剩余数组有序

Alibaba cloud Zhang Xintao: heterogeneous computing provides surging power for the digital economy

The road to success in R & D efficiency of 1000 person Internet companies
![[event preview] cloud digital factory and digital transformation and innovation forum for small and medium-sized enterprises](/img/6f/f7c5d605ea9b7b9e7c49ac716492ef.jpg)
[event preview] cloud digital factory and digital transformation and innovation forum for small and medium-sized enterprises

Day 5
随机推荐
Solution: find the position of the first and last element in a sorted array (personal notes)
文件结尾
MySQL的基础概念+数据库系统结构+拓展延申+基础命令学习
365天挑战LeetCode1000题——Day 040 设计跳表 + 避免洪水泛滥 + 查找大小为 M 的最新分组 + 销售价值减少的颜色球
[event preview] cloud development, efficient and intelligent - the second Alibaba cloud ECS cloudbuild developer competition is about to start
冒泡排序 C语言
直播预告|如何节省30%人工成本,缩短80%商标办理周期?
数据泄漏、删除事件频发,企业应如何构建安全防线?
365天挑战LeetCode1000题——Day 036 二叉树剪枝 + 子数组和排序后的区间和 + 删除最短的子数组使剩余数组有序
浅谈Servlet
D3d Shader Instruction
Why is Google's internal tools not suitable for you?
Preemptive appointment | Alibaba cloud shadowless cloud application online conference appointment opens
365天挑战LeetCode1000题——Day 037 元素和小于等于阈值的正方形的最大边长 + 满足条件的子序列数目
365 day challenge leetcode 1000 questions - day 039 full binary tree inserter + find peak II + snapshot array
C语言 N皇后问题
分配内存:malloc()和free()
适创科技以云仿真平台,支持“中国智造”升级
Li Yan, CEO of parallel cloud: cloudxr, opens the channel to the metauniverse
In depth analysis of common cross end technology stacks of app