Git Product home page Git Product logo

Comments (4)

Sayi avatar Sayi commented on May 14, 2024

是从一个word中拷贝目录到另一个word中吗?如果是简单拷贝的话,apache poi默认应该有这些功能。

场景可以说的再具体点。

from poi-tl.

kealina avatar kealina commented on May 14, 2024

不是简单的拷贝哦!我是要对它进行改格式,我只能读取它的文本内容,然后写一个template对它进行格式化。

假如有一份已经有目录的文件,可是它的样式和排版都不是我想要的,所以我就读取里面的内容然后对它进行再次格式化,而且它有多少级的目录是我不能确定的,但是我要求他的第一级目录要求四号宋体,如果有第二级目录就要求四号小黑体,如果有第三级目录又是另外一种样式。大概就是这样一个意思。

from poi-tl.

Sayi avatar Sayi commented on May 14, 2024

@kealina
我觉得可以这样来:

  1. 读取原word的目录
  2. 写入目录到另一个word,并且针对不同级的目录设置自己想要的样式

读取目录的具体代码参考POI的API:

CTP ctp = xwpfParagraph.getCTP();
List<CTBookmark> bookmarkStartList = ctp.getBookmarkStartList();
...

关于ctr+点击要跳转这个问题有个前提:
1.需要设置跳转处锚点
2.如果目录有页码,可能随着文档字体变化页码要更新

from poi-tl.

kealina avatar kealina commented on May 14, 2024

好的,感谢回答,我去试试

from poi-tl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.