Page 1 of 1

convert docx to html ignore dots in Table of content

PostPosted: Thu Sep 06, 2018 11:29 pm
by carlos
Hi everyone,
Im a newbie in docx4j and I'm facing some troubles when transforming docx to html and vice versa.
Firstly, I'm transforming a docx file into Html. It should be noted that this document has a table of contents. When I'm rendering this Html, the dots in the TOC are missing.

InputStream is = resultDoc.getFileStream();
WordprocessingMLPackage wordMLPackage = Docx4J.load(is);
File home = new File(System.getProperty("user.dir")).getParentFile().getParentFile();
removeSDTs(wordMLPackage);
HTMLSettings htmlSettings = Docx4J.createHTMLSettings();
htmlSettings.setImageDirPath(home);
htmlSettings.setWmlPackage(wordMLPackage);
OutputStream out = new ByteArrayOutputStream();


Docx4jProperties.setProperty("docx4j.Convert.Out.HTML.OutputMethodXML.", true);
Docx4jProperties.setProperty("docx", true);
Docx4J.toHTML(htmlSettings, out, Docx4J.FLAG_EXPORT_PREFER_XSL);

I have already analysed the html before sending it to frontend just to make sure it is not an issue of the plugin which renders this html.

Please i would apreciate your help :)
Thanks in advance
Carlos