I am using docx4j-ImportXHTML to convert an XHTML into docx. When rendering to docx I am missing some style information.
<!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>
<title>Title of document</title>
</head>
<body>
<p>This is <b>bold</b></p>
------------------------
<p style="margin-top:200px;margin-right:150px;margin-bottom:100px;margin-left:100px;">indent text</p>
------------------------
</body>
</html>
When running the above code, I do not see any top margin in the docx
(left margin is there though). Also, if margins are defined as %, e.g., margin-left:4%
, docx4j connot recognize it.
XHTML
to docx
?Are you trying to add space around a paragraph, or page margins?
If you wanted page margins, you'd need paged media css to translate to w:sectPr/w:pgMargin
At the Flying Saucer end, see https://flyingsaucerproject.github.io/flyingsaucer/r8/guide/users-guide-R8.html#xil_36
I don't think we translate that instruction yet though.