0

I want to be able to generate .docx files through either Java or Python based off of a template .docx file. I need to be able to insert in simple text, some bullets and a table or two.

I would like suggestions on specific libraries/modules for either Python or Java that would allow me to load a template, insert basic text and tables and then save it.

I have been looking into JACOB for Java and docx for Python. Any alternatives? Or will one of these be able to do what I need?

Thanks in advance

1

3 Answers 3

1

If you want to generate a docx, than you might like docxtemplater, which is a library I maintain which does docx generation from a template (much like Mustache for HTML).

It runs on node but has a command line interface so you can use it from any language.

DocxTemplater Library

Demo Site

Sign up to request clarification or add additional context in comments.

3 Comments

Just so you are aware, the pictures are broken at the Demo Site link.
Interesting. I am fairly new to coding so could you explain how to use the command line interface from within java? This looks like the best option since it can handle bullets and tables.
I never coded java but here is a so question about running command line with java google.de/…
1

Give docx4j as a choice, it's based on Apache POI but with better documentation

1 Comment

Thank you, this might be the way to go. Although jacob is looking promising.
0

Did you look at Aapache POI (the Java API for Microsoft Documents) project?

http://poi.apache.org/

Good luck!

2 Comments

I seemed to me that it was more meant for excel. I didn't know if it was capable of dealing with tables. I will look further into it however.
Sorry that I only used it for Excel, but it should work for word as well. Please refer to this discussion stackoverflow.com/questions/13507424/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.