How to open and manipulate Word document/template in Java?

前端 未结 5 1014
日久生厌
日久生厌 2020-12-13 20:35

I need to open a .doc/.dot/.docx/.dotx (I\'m not picky, I just want it to work) document, parse it for placeholders (or something similar), put my own data, an

5条回答
  •  萌比男神i
    2020-12-13 21:13

    I ended up relying on Apache Poi 3.12 and processing paragraphs (separately extracting paragraphs also from tables, headers/footers, and footnotes, as such paragraphs aren't returned by XWPFDocument.getParagraphs() ).

    The processing code (~100 lines) and unit tests are here on github.

提交回复
热议问题