docx to html using docx4j on Android 4.0.3 demo project
Latest commit a195413 Jan 6, 2017 @plutext committed on GitHub Update README.txt


Update January 2017: For a modern Android Studio app, using docx4j 3.3.x, please see instead

Convert sample.docx to HTML on Android, using docx4j.

When you run it, the app should come up with 2 tabs, one displaying the web page, the other the HTML source.

The docx which is converted is the one in res/raw directory.

If you look at you'll see that you can choose to have HTML images saved as files on the device, or based64 encoded as a data URI.  The latter makes the HTML source harder to read, but avoids issues writing to the device (cleanup etc), see 

To run this Eclipse project, you'll probably need to increase your heap space in eclipse.ini (symptom is 'you get Unable to execute dex: Java heap space').  

I used: 

In Eclipse, Windows > Preferences > General > Show Heap Status gives you an entry on the bottom row which is useful.

Because Android does not support JAXB out of the box, this project contains jars which came from:

Note: The set of jars here is the minimal set required for HTML output.  Certain other docx4j features will require additional jars, which are not present in this project.