【问题标题】:Is Apache POI supports replacing merge fields in docx?Apache POI 是否支持替换 docx 中的合并字段?
【发布时间】:2019-09-17 09:00:52
【问题描述】:

在段落和多列表格中用 apache-poi 的值替换 ms 单词合并字段。

由于 docx4j 提供了替换合并字段的功能,apache poi 是否有任何等效功能。由于我在 Docx 文件中使用了一些自定义标签,因此在 docx4j 中读取文件会忽略自定义标签(xml 格式“w:xyz”)。

输入模板

Name «name»

Table :   (Need to add n- number of records to the template)  
ID      Name
«id»    «name»

预期输出:

Name:  Stack

    ID  Name
    1   Java
    2   Apache

【问题讨论】:

    标签: apache-poi ms-office docx mergefield


    【解决方案1】:

    没有。
    但是有一个 apache 库,名为 Freemarker
    它是一个模板引擎,完全支持您要查找的内容。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-08-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-12-13
      • 1970-01-01
      相关资源
      最近更新 更多