wordMLPackage = Docx4J.load(new java.io.File(inputfilepath));
}
// HTML exporter setup (required)
// .. the HTMLSettings object
HTMLSettings htmlSettings = Docx4J.createHTMLSettings();
htmlSettings.setImageDirPath(inputfilepath + "_files");
htmlSettings.setImageTargetUri(inputfilepath.substring(inputfilepath.lastIndexOf("/")+1)
+ "_files");
htmlSettings.setWmlPackage(wordMLPackage);
/* CSS reset, see http://itumbcom.blogspot.com.au/2013/06/css-reset-how-complex-it-should-be.html
*
* motivated by vertical space in tables in Firefox and Google Chrome.
If you have unwanted vertical space, in Chrome this may be coming from -webkit-margin-before and -webkit-margin-after
(in Firefox, margin-top is set to 1em in html.css)
Setting margin: 0 on p is enough to fix it.
See further http://www.css-101.org/articles/base-styles-sheet-for-webkit-based-browsers/
*/
String userCSS = "html, body, div, span, h1, h2, h3, h4, h5, h6, p, a, img, ol, ul, li, table, caption, tbody, tfoot, thead, tr, th, td " +
"{ margin: 0; padding: 0; border: 0;}" +
"body {line-height: 1;} ";
htmlSettings.setUserCSS(userCSS);
//Other settings (optional)
// htmlSettings.setUserBodyTop("<H1>TOP!</H1>");
// htmlSettings.setUserBodyTail("<H1>TAIL!</H1>");