开发者

Docx4J command line to convert doc/docx files to html [closed]

Closed. This question needs debugging details. It is not currently accepting answers.

Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer 开发者_如何学Cthe question.

Closed 5 years ago.

Improve this question

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).


looking at http://dev.plutext.org/svn/docx4j/trunk/docx4j/docs/Docx4j_GettingStarted.html and the samples dir, i would think that

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

should work. note the following from the Getting Started > Command Line Samples section:

If there are any images in the docx, you'd also need:

xmlgraphics-commons-1.4.jar
commons-logging-1.1.1.jar

on your classpath.


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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜