I have been tasked to find a way to convert a large amount of .docx files to docbook 5. Currently, we open the file in openoffice and save to docbook. This is a time consuming task, but I am confident there is a better way. These files will then be processed further to our custom relax NG schema. Therefore this conversion does not need to be flawless. I have looked around, and will continue to investigate some leads, but have not found anything usefull.
looking at Convert doc/docx to semantic HTML they have suggested upCast, but this does not seem appropriate to my needs.
I am looking for something freely available that I can use from the command line. I ultimately I would like to batch process our files. I have included the linux, python, and java tags for these are the environments I am most comfortable, but would be willing to bend for the right solution. I am trying to do some research before I go out and reinvent the wheel.
At the risk of earning an archeologist's badge from SX, the answers should include a reference to Pandoc. This does not rely on open office.
pandoc -f docx -t docbook -o newdocbook.dbk --standalone original.docx
There are several ways to script this, both using external scripts and scripts within OpenOffice. See the following links for some examples:
Some of the above links aren't using Java or Python, but the principles still apply and the scripts are typically short enough that they can be ported (the first example is in Ruby, but it's my personal favorite due to the simplicity).
You can run openoffice in server mode and feed the docs to it without having to manually open each on.
One way: http://code.google.com/p/bungeni-editor/wiki/RunningTheJODConverterServer
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With