Search code examples
javadocx4j

Docx4J command line to convert doc/docx files to html


I have been trying to convert doc/docx files to html, the best bet I found is docx4j. Can anyone please help me with a straight command line to do this job.

I tried:

java -cp docx4j.jar:log4j-1.2.15.jar org.docx4j.samples.CreateHtml [input.docx]

In response I would expect HTML output (either to the console or a file).


Solution

  • Many thanks to ax for providing line of thought, but that command gave Class missing error so all was needed to include other jar files in path.

    java -cp docx4j-2.6.0.jar:log4j-1.2.15.jar:xalan-2.7.1.jar:serializer-2.7.1.jar:xml-apis-1.3.04.jar:commons-logging-1.1.1.jar:commons-lang-2.4.jar:commons-io-1.3.1.jar:commons-codec-1.3.jar:xmlgraphics-commons-1.4.jar org.docx4j.samples.CreateHtml input.doc