Page 1 of 1

horizontal line missing while converting xhtml to docx

PostPosted: Wed Nov 12, 2014 7:01 pm
by mail2sundareee
I am converting xhtml to docx using doc4j. But the horizontal line that is present in xhtml is not being added to the docx. following is the snippet I am using. Can anyone please help me in fixing this?

String stringFromFile = FileUtils.readFileToString(new File(dest

+ "/" + xhtmlFile), "UTF-8");
WordprocessingMLPackage docxOut = WordprocessingMLPackage
.createPackage();

NumberingDefinitionsPart ndp = new NumberingDefinitionsPart();
docxOut.getMainDocumentPart().addTargetPart(ndp);
ndp.unmarshalDefaultNumbering();
XHTMLImporterImpl XHTMLImporter = new XHTMLImporterImpl(docxOut);
XHTMLImporter.setHyperlinkStyle("Hyperlink");
docxOut.getMainDocumentPart().getContent()
.addAll(XHTMLImporter.convert(stringFromFile, null));

Re: horizontal line missing while converting xhtml to docx

PostPosted: Thu Nov 13, 2014 8:03 am
by jason
Locking dupe/cross post of http://stackoverflow.com/questions/2688 ... sing-doc4j

Please don't do this.