我有一个docx文件,其中包含需要填充的某些部分/填充。 我正在尝试使用 Docx4J 和 JAXB 解析文件。 如果docx是简单格式且未格式化,则很好。
我的docx文件的上部包含“地址”。然后是身体,然后是有样式的桌子。 在使用Docx4J时,我收到了文本,但无法得到样式。
我脑子里有办法,但是只是想知道我们是否有针对此类案件的更好的图书馆或办法。
**Approaches:**
1. To convert docx in zip, extract the styles.xml. Change the text whereever i want to do and then inject the styles again. Create zip and convert to docx.
2. Any libraries which gives me styles with the text -- if any please let me know
3. Get the text and create the docx again on our own by including the styles.
请让我知道我可以使用什么或最好的使用方式。
如果您需要我的更多信息,请告诉我。