Word document creation API in Java

后端 未结 8 885
小鲜肉
小鲜肉 2020-12-15 10:57

I would like to create a word document using a template, replace some variables (fields) and save it as a new word document.

I was thinking using Apache POI, http:/

8条回答
  •  抹茶落季
    2020-12-15 11:25

    I'm not sure of the exact status of the Word documents support in POI but, according to the POI website, work is still in progress (can't say what this mean exactly). So, at this time, I would not use POI but rather try to generate a RTF document. For this, you could :

    • Use RTFTemplate which is a RTF to RTF Engine that can generate RTF document as the result of the merge of a RTF model and data.
    • Use iText which is primarly a PDF generator but can also generate RTF.
    • Build your own custom solution (but I wouldn't do that).

    I'd go for iText.

提交回复
热议问题