Word to html generates bold style for nested lists.
This is our code:
String convertedHtml = null;
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
try {
Document doc = new Document(is);
HtmlSaveOptions options = new HtmlSaveOptions(SaveFormat.HTML);
options.setExportHeadersFootersMode(ExportHeadersFootersMode.NONE);
options.setExportImagesAsBase64(true);
doc.joinRunsWithSameFormatting();
doc.save(outputStream, options);
convertedHtml = outputStream.toString("UTF-8");
} catch (Exception e) {
log.error("Error while converting byte array to HTML.", e);
} finally {
try {
is.close();
} catch (IOException e) {
e.printStackTrace();
}
try {
outputStream.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return convertedHtml;
}