Hello All,
I am trying to convert xhtml to docx.
My xHtml contains table and inside there are <ul <li, so when I convert it docx, bullets are not getting formatted properly.
Below is the test code for converting xhtml to docx,
WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.createPackage();
AlternativeFormatInputPart afiPart = new AlternativeFormatInputPart(AltChunkType.Xhtml);
afiPart.setBinaryData(html.getBytes("UTF-8"));
afiPart.setContentType(new ContentType("application/xhtml+xml"));
Relationship altChunkRel = wordMLPackage.getMainDocumentPart().addTargetPart(afiPart);
// .. the bit in document body
CTAltChunk ac = Context.getWmlObjectFactory().createCTAltChunk();
ac.setId(altChunkRel.getId());
wordMLPackage.getMainDocumentPart().addObject(ac);
wordMLPackage.getContentTypeManager().addDefaultContentType("xhtml", "application/xhtml+xml");
// ...