Java 生成大型Word文档,有没有好的解决方案?
怪我咯
怪我咯 2017-04-17 13:01:28
0
3
540

需要根据模板通过替换之类的操作,生成复杂的word文档,少则七八十也,多则上百页。

从效率上考虑有没有好的解决方案?

谢谢。

怪我咯
怪我咯

走同样的路,发现不同的人生

reply all(3)
左手右手慢动作

If you only consider docx, you can convert the file into zip and then decompress it. Find the xml part and replace it with a template. It will definitely be faster than jacob and the like
If it is doc, I personally think there is no solution and the cost of studying binary is too high

小葫芦

I’ve made one before. Edit the word format first, and then save it as xml format. Then open it with Notepad or Notepad++, the latter is recommended because regular expressions can be used. Then replace the empty position where you want to fill in the content with ${parameter}. Then use freemarker to brush data inside. Very fast.

洪涛

Use OOXML format

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!