I have an issue with some styles after converting this html file to document.
div,p{
background-color: #ff0000;
padding: 100px;
border: 10px solid #000;
text-align: justify;
margin-bottom: 50px;
text-indent: 50px;
}
test test test
test test test
test test test
test test test
test test test
test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test
Using following unit test
@Test
public void testConvertXhtml3() throws Exception
{
String inputfilepath = "/Users/kyv/Documents/test.html";
// Create an empty docx package
WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.createPackage();
NumberingDefinitionsPart ndp = new NumberingDefinitionsPart();
wordMLPackage.getMainDocumentPart().addTargetPart(ndp);
ndp.unmarshalDefaultNumbering();
XHTMLImporterImpl xHTMLImporter = new XHTMLImporterImpl(wordMLPackage);
// Convert the XHTML, and add it into the empty docx we made
wordMLPackage.getMainDocumentPart().getContent().addAll(xHTMLImporter.convert(new File(inputfilepath), null) );
wordMLPackage.save(new java.io.File("/Users/kyv/Documents/test.docx") );
}
In console I get a lot of "How to handle: ..." Part of log
Attempting to load: docx4j.properties
Using paper size: A4
Landscape orientation: false
Set contentType application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml on part /
java.vendor=Oracle Corporation
java.version=1.7.0_55
jar:file:/Users/kvn/.m2/repository/com/sun/xml/bind/jaxb-impl/2.2.3-1/jaxb-impl-2.2.3-1.jar!/META-INF/MANIFEST.MF
Implementation-Title : JAXB Reference Implementation
Implementation-Version : 2.2.3
Class-Path : jaxb-api.jar activation.jar jsr173_1.0_api.jar jaxb1-impl.jar
Manifest-Version : 1.0
Specification-Vendor : Oracle Corporation
Created-By : 1.5.0_22-b03 (Sun Microsystems Inc.)
Ant-Version : Apache Ant 1.7.1
Implementation-Vendor : Oracle Corporation
Implementation-Vendor-Id : com.sun
Specification-Title : Java Architecture for XML Binding
Specification-Version : 2.2.2
Extension-Name : com.sun.xml.bind
Build-Id : hudson-jaxb-ri-2.2.3-3
Found JAXB reference implementation in jar:file:/Users/kushniry/.m2/repository/com/sun/xml/bind/jaxb-impl/2.2.3-1/jaxb-impl-2.2.3-1.jar!/META-INF/MANIFEST.MF
Implementation-Version : 2.2.3-hudson-jaxb-ri-2.2.3-3-
Attempting to load: org/docx4j/wml/jaxb.properties
Not using MOXy, since no resource: org/docx4j/wml/jaxb.properties
No MOXy JAXB config found; assume not intended..
org/docx4j/wml/jaxb.properties not found via cla