Page 1 of 1

Indent a paragraph

PostPosted: Tue Apr 08, 2014 9:28 pm
by geoM
Hi,
I use XHTMLImporter to generate a Word file from an existing HTML. It works fine, except when I want to indent a whole paragraph.

The following example works correctly:
Code: Select all
<div style="margin-left:15mm">
  Text ...
</div>

It is generated following (document.xml):
Code: Select all
. . .
<w:p>
         <w:pPr>
            <w:spacing w:after="0"/>
            <w:ind w:left="851"/>
            <w:jc w:val="left"/>
         </w:pPr>
         <w:r>
            <w:rPr>
               <w:b w:val="false"/>
               <w:i w:val="false"/>
               <w:color w:val="000000"/>
               <w:sz w:val="20"/>
            </w:rPr>
            <w:t>Text ...</w:t>
         </w:r>
</w:p>
. . .

The next example does not work properly:
Code: Select all
<div style="margin-left:15mm">
   <p>Text ...</p>
</div>

This time it is generated following (document.xml):
Code: Select all
<w:p>
         <w:pPr>
            <w:spacing w:after="0"/>
            <w:ind w:left="0"/>
            <w:jc w:val="left"/>
         </w:pPr>
         <w:r>
            <w:rPr>
               <w:b w:val="false"/>
               <w:i w:val="false"/>
               <w:color w:val="000000"/>
               <w:sz w:val="20"/>
            </w:rPr>
            <w:t>Text ...</w:t>
         </w:r>
</w:p>

and the value of margin-left is lost.

Any help would be greatly appreciated, thanks!

Re: Indent a paragraph

PostPosted: Fri May 16, 2014 11:21 pm
by parisd
Have you tried defining the style in the <p> tag?

Code: Select all
<div>
   <p style="margin-left:15mm">Text ...</p>
</div>