Is there an alternative to open-xml sdk to generate word documents

别来无恙 提交于 2020-01-01 16:47:22

问题


I'm trying to generate word documents using open xml sdk. When the documents are small this is no problem (and rather easy). When the documents become larger (+500 pages) I notice the peformance (duration, memory usage, ...) goes down significantly.

Googling this problem I came across some posts that point out the same problem. For excel there is a solution with spreadsheetgear.

I would like to know if there is a word alternative to this or if there are other solutions to generate word documents?

Thanks, Jelle


回答1:


I've written a blog post series on generating Open XML WordprocessingML documents. The approach that I take is that you create a template Word document, insert content controls, and then write XPath expressions in those content controls to specify the XML to pull from a source XML data file. I've also explored another approach where you write C# code in Open XML content controls. That approach also works.

http://ericwhite.com/blog/map/generating-open-xml-wordprocessingml-documents-blog-post-series/

-Eric




回答2:


You might look at http://docx.codeplex.com/

On Java, you could use docx4j. If you were brave, you could create DLLs for it via IKVM...




回答3:


I decided to go with Aspose Words. It is really fast and not very demanding on resources (CPU, memory). It has the disadvantage that it is quite expensive. I also investigated Softartisans Office writer. The posibilities are the same but due to fact that the company I'm currently working for already used other Aspose components we decided to go with Aspose Word.



来源:https://stackoverflow.com/questions/3044653/is-there-an-alternative-to-open-xml-sdk-to-generate-word-documents

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!