Comments (4)
是从一个word中拷贝目录到另一个word中吗?如果是简单拷贝的话,apache poi
默认应该有这些功能。
场景可以说的再具体点。
from poi-tl.
不是简单的拷贝哦!我是要对它进行改格式,我只能读取它的文本内容,然后写一个template对它进行格式化。
假如有一份已经有目录的文件,可是它的样式和排版都不是我想要的,所以我就读取里面的内容然后对它进行再次格式化,而且它有多少级的目录是我不能确定的,但是我要求他的第一级目录要求四号宋体,如果有第二级目录就要求四号小黑体,如果有第三级目录又是另外一种样式。大概就是这样一个意思。
from poi-tl.
@kealina
我觉得可以这样来:
- 读取原word的目录
- 写入目录到另一个word,并且针对不同级的目录设置自己想要的样式
读取目录的具体代码参考POI的API:
CTP ctp = xwpfParagraph.getCTP();
List<CTBookmark> bookmarkStartList = ctp.getBookmarkStartList();
...
关于ctr+点击要跳转这个问题有个前提:
1.需要设置跳转处锚点
2.如果目录有页码,可能随着文档字体变化页码要更新
from poi-tl.
好的,感谢回答,我去试试
from poi-tl.
Related Issues (20)
- Markdown tag inside block pairs is not working HOT 2
- 怎么在表格中循环插入表格数据 HOT 1
- 文本内容中的换行符未被正确渲染为不同的段落
- 渲染标签失败
- 报表标签渲染失败
- poi-tl再发新版本时,能把poi-tl-plugin-markdown的版本改成1.0.4版本吗?
- paragraph.getCTP().removeR(2),发生java.lang.IndexOutOfBoundsException HOT 1
- 如何渲染模板中的公式 HOT 1
- 是否支持导出word中的表格实现每页都输出表头信息? HOT 1
- 如何实现表格行循环嵌套循环 HOT 1
- 报告中图表生成报错:SAXParseException: Premature end of file. HOT 3
- 1.10版本在结构体中渲染时出现问题 HOT 4
- 动态表格渲染数据样式问题
- 多层分类的横轴 如何配置参数实现?
- 我想实现在word文档的最后一页的底部插入一个表格或者一个段落 悬浮在文档的最下面,请问使用模板的方式支持吗?
- 使用代码高亮插件后添加水印,不显示,应该是被遮住了。 HOT 1
- Problem with hidden text in Word templates HOT 2
- 区块判断不了boolean类型值 HOT 2
- 插入图片,生成的word有些图片为什么会给旋转了,有些图片却不会。
- 插入图片后,生成的word有些图片被旋转了,有些图片却正常的。
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from poi-tl.