jason wrote:What bullets does your source docx contain?
Hi Jason,
many thanks for replying.
My docx contains the flower bullet:
I am using the below code to set it to a particular bullet type but even that is not happening
public class ConvertOutHtml extends AbstractSample {
String getMyDir(){
return "docx/testfile.docx";
}
String getMyDir1(){
return "html/testfile.html";
}
public static void main(String[] args){
try{
ConvertOutHtml coh = new ConvertOutHtml();
String inputfilepath = coh.getMyDir();
String outputfilepath = coh.getMyDir1();
// Document loading (required)
InputStream is = new FileInputStream(new File("docx/testfile.docx"));
// Create a docx
WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(is);
// HTML exporter setup (required)
// .. the HTMLSettings object
HtmlSettings htmlSettings = new HtmlSettings();
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;} "+"li{list-style:square;}";
htmlSettings.setUserCSS(userCSS);
OutputStream out = new FileOutputStream(outputfilepath);
AbstractHtmlExporter exporter = new HtmlExporterNG2();
StreamResult result = new StreamResult(out);
exporter.html(wordMLPackage, result, htmlSettings);
System.out.println("Saved: ");
}catch(InvalidFormatException ife){
ife.printStackTrace();
}catch(Docx4JException d4je){
d4je.printStackTrace();
}catch(Exception e){
e.printStackTrace();
}
}
}