Hi,
I've just tested
docx4j-3.2.0-beta.jar und
docx4j-ImportXHTML-3.2.0-beta.jar
with <p style="line-height: 250%;"> and it has not been accepted, even as a class in a css file.
I do something wrong?
Any help would be greatly appreciated, thanks!
String xhtml = "<p style='line-height: 250%;'>Hello...
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="css/word.css" rel="stylesheet" type="text/css"/>
<title>
Teildokument
</title>
</head>
<body>
<p style="line-height: 250%;">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, ..</p>
</body>
</html>
WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.createPackage();
XHTMLImporterImpl xHTMLImporter = new XHTMLImporterImpl(wordMLPackage);
try {
wordMLPackage.getMainDocumentPart().getContent().addAll(xHTMLImporter.convert(new File(filePath), null) );
}
catch (org.docx4j.org.xhtmlrenderer.util.XRRuntimeException xrre) {
. . .
}
SaveToZipFile saver = new SaveToZipFile(wordMLPackage);
. . .
<w:document mc:Ignorable="w14 wp14">
<w:body>
<w:p>
<w:pPr>
<w:spacing w:after="0"/>
</w:pPr>
<w:bookmarkStart w:name="_GoBack" w:id="0"/>
<w:bookmarkEnd w:id="0"/>
<w:proofErr w:type="spellStart"/>
<w:r>
<w:rPr>
<w:color w:val="000000"/>
<w:sz w:val="20"/>
</w:rPr>
<w:t>Lorem</w:t>
</w:r>
<w:proofErr w:type="spellEnd"/>
<w:r>
<w:rPr>
<w:color w:val="000000"/>
<w:sz w:val="20"/>
</w:rPr>
<w:t xml:space="preserve"> </w:t>
</w:r>
<w:proofErr w:type="spellStart"/>
<w:r>
<w:rPr>
<w:color w:val="000000"/>
<w:sz w:val="20"/>
</w:rPr>
<w:t>ipsum</w:t>
</w:r>
<w:proofErr w:type="spellEnd"/>
<w:r>
<w:rPr>
<w:color w:val="000000"/>
<w:sz w:val="20"/>
</w:rPr>
<w:t xml:space="preserve"> dolor sit </w:t>
</w:r>
. . . . . . . . . .
Users browsing this forum: No registered users and 12 guests