I'm using the following codes to convert a docx file to hmtl:
public class DocxToHTML {
// Config for non-command line version
static {
//inputfilepath = System.getProperty("user.dir") + "/sample-docs/word/sample-docxv2.docx;
inputfilepath = "test3.docx";
save = true;
}
static String inputfilepath;
static boolean save;
public static void main(String[] args) throws Exception {
convert(args);
}
public static void convert(String[] args)
throws Exception {
// Document loading (required)
WordprocessingMLPackage wordMLPackage;
wordMLPackage = Docx4J.load(new java.io.File(inputfilepath));
// HTML exporter setup (required) ...